Merge pull request #3918 from ZappoMan/acEntityCrash

Ac entity crash
This commit is contained in:
Philip Rosedale 2014-12-08 09:16:40 -08:00
commit 732b40f68c
2 changed files with 9 additions and 2 deletions

View file

@ -103,6 +103,9 @@ function updateButterflies(deltaTime) {
var CHANCE_OF_IMPULSE = 0.04;
for (var i = 0; i < numButterflies; i++) {
if (Math.random() < CHANCE_OF_IMPULSE) {
if (!butterflies[i].isKnownID) {
butterflies[i] = Entities.identifyEntity(butterflies[i]);
}
var properties = Entities.getEntityProperties(butterflies[i]);
if (Vec3.length(Vec3.subtract(properties.position, flockPosition)) > range) {
Entities.editEntity(butterflies[i], { position: flockPosition } );

View file

@ -19,9 +19,13 @@
#include "MovingEntitiesOperator.h"
#include "UpdateEntityOperator.h"
EntityTree::EntityTree(bool shouldReaverage) : Octree(shouldReaverage), _simulation(NULL) {
EntityTree::EntityTree(bool shouldReaverage) :
Octree(shouldReaverage),
_fbxService(NULL),
_lightsArePickable(true),
_simulation(NULL)
{
_rootElement = createNewElement();
_lightsArePickable = true; // assume they are by default
}
EntityTree::~EntityTree() {