History

Merge branch 'master' into bug-fix/tablet-ui-no-domain

Anthony J. Thibault committed 9 years ago

Commit 6bef9e82 parents e2e1988 f40285c70 files · +1837 −688Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 70 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+10−6
@@ -226,6 +226,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 225 unmodified lines
226226 // and make note of it now, so we can act on it right away.
227227 propertiesWithSimID.setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY);
228228 entity->setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY);
229+ entity->rememberHasSimulationOwnershipBid();
229230 }
230231
231232 entity->setLastBroadcast(usecTimestampNow());
@@ -436,6 +437,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 204 unmodified lines
436437 // we make a bid for simulation ownership
437438 properties.setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY);
438439 entity->pokeSimulationOwnership();
440+ entity->rememberHasSimulationOwnershipBid();
439441 }
440442 }
441443 if (properties.parentRelatedPropertyChanged() && entity->computePuffedQueryAACube()) {
@@ -1359,12 +1361,14 @@ bool EntityScriptingInterface::isChildOfParent(QUuid childID, QUuid parentID) { · 917 unmodified lines
13591361
13601362 _entityTree->withReadLock([&] {
13611363 EntityItemPointer parent = _entityTree->findEntityByEntityItemID(parentID);
1362− parent->forEachDescendant([&](SpatiallyNestablePointer descendant) {
1363− if(descendant->getID() == childID) {
1364− isChild = true;
1365− return;
1366− }
1367− });
1364+ if (parent) {
1365+ parent->forEachDescendant([&](SpatiallyNestablePointer descendant) {
1366+ if (descendant->getID() == childID) {
1367+ isChild = true;
1368+ return;
1369+ }
1370+ });
1371+ }
13681372 });
13691373
13701374 return isChild;