Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 70 files). Show all
Unified · Split
| @@ -226,6 +226,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 225 unmodified lines | ||
| 226 | 226 | // and make note of it now, so we can act on it right away. |
| 227 | 227 | propertiesWithSimID.setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY); |
| 228 | 228 | entity->setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY); |
| 229 | + entity->rememberHasSimulationOwnershipBid(); | |
| 229 | 230 | } |
| 230 | 231 | |
| 231 | 232 | entity->setLastBroadcast(usecTimestampNow()); |
| @@ -436,6 +437,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 204 unmodified lines | ||
| 436 | 437 | // we make a bid for simulation ownership |
| 437 | 438 | properties.setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY); |
| 438 | 439 | entity->pokeSimulationOwnership(); |
| 440 | + entity->rememberHasSimulationOwnershipBid(); | |
| 439 | 441 | } |
| 440 | 442 | } |
| 441 | 443 | if (properties.parentRelatedPropertyChanged() && entity->computePuffedQueryAACube()) { |
| @@ -1359,12 +1361,14 @@ bool EntityScriptingInterface::isChildOfParent(QUuid childID, QUuid parentID) { · 917 unmodified lines | ||
| 1359 | 1361 | |
| 1360 | 1362 | _entityTree->withReadLock([&] { |
| 1361 | 1363 | 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 | + } | |
| 1368 | 1372 | }); |
| 1369 | 1373 | |
| 1370 | 1374 | return isChild; |