History

reduce sim ownership priority when releasing grab

Andrew Meadows committed 8 years ago

Commit 00e360a1 parent 926014b9 files · +160 −146Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+5−5
@@ -277,7 +277,7 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 276 unmodified lines
277277
278278 entity->setLastBroadcast(usecTimestampNow());
279279 // since we're creating this object we will immediately volunteer to own its simulation
280− entity->flagForOwnershipBid(VOLUNTEER_SIMULATION_PRIORITY);
280+ entity->setScriptSimulationPriority(VOLUNTEER_SIMULATION_PRIORITY);
281281 propertiesWithSimID.setLastEdited(entity->getLastEdited());
282282 } else {
283283 qCDebug(entities) << "script failed to add new Entity to local Octree";
@@ -465,7 +465,7 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 181 unmodified lines
465465 } else {
466466 // we make a bid for simulation ownership
467467 properties.setSimulationOwner(myNodeID, SCRIPT_POKE_SIMULATION_PRIORITY);
468− entity->flagForOwnershipBid(SCRIPT_POKE_SIMULATION_PRIORITY);
468+ entity->setScriptSimulationPriority(SCRIPT_POKE_SIMULATION_PRIORITY);
469469 }
470470 }
471471 if (properties.queryAACubeRelatedPropertyChanged()) {
@@ -1334,7 +1334,7 @@ QUuid EntityScriptingInterface::addAction(const QString& actionTypeString, · 862 unmodified lines
13341334 }
13351335 action->setIsMine(true);
13361336 success = entity->addAction(simulation, action);
1337− entity->flagForOwnershipBid(SCRIPT_GRAB_SIMULATION_PRIORITY);
1337+ entity->setScriptSimulationPriority(SCRIPT_GRAB_SIMULATION_PRIORITY);
13381338 return false; // Physics will cause a packet to be sent, so don't send from here.
13391339 });
13401340 if (success) {
@@ -1350,7 +1350,7 @@ bool EntityScriptingInterface::updateAction(const QUuid& entityID, const QUuid& · 9 unmodified lines
13501350 return actionWorker(entityID, [&](EntitySimulationPointer simulation, EntityItemPointer entity) {
13511351 bool success = entity->updateAction(simulation, actionID, arguments);
13521352 if (success) {
1353− entity->flagForOwnershipBid(SCRIPT_GRAB_SIMULATION_PRIORITY);
1353+ entity->setScriptSimulationPriority(SCRIPT_GRAB_SIMULATION_PRIORITY);
13541354 }
13551355 return success;
13561356 });
@@ -1364,7 +1364,7 @@ bool EntityScriptingInterface::deleteAction(const QUuid& entityID, const QUuid& · 7 unmodified lines
13641364 success = entity->removeAction(simulation, actionID);
13651365 if (success) {
13661366 // reduce from grab to poke
1367− entity->flagForOwnershipBid(SCRIPT_POKE_SIMULATION_PRIORITY);
1367+ entity->setScriptSimulationPriority(SCRIPT_POKE_SIMULATION_PRIORITY);
13681368 }
13691369 return false; // Physics will cause a packet to be sent, so don't send from here.
13701370 });