History

adjust simulation bid priority by props changed

Andrew Meadows committed 8 years ago

Commit 6558d531 parent 9bfa4a53 files · +18 −3Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+3−3
@@ -562,14 +562,14 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 561 unmodified lines
562562 if (entity) {
563563 if (properties.hasSimulationRestrictedChanges()) {
564564 if (_bidOnSimulationOwnership) {
565+ // flag for simulation ownership, or upgrade existing ownership priority
566+ // (actual bids for simulation ownership are sent by the PhysicalEntitySimulation)
567+ entity->upgradeScriptSimulationPriority(properties.computeSimulationBidPriority());
565568 if (simulationOwner.getID() == sessionID) {
566569 // we own the simulation --> copy ALL restricted properties
567570 properties.copySimulationRestrictedProperties(entity);
568571 } else {
569572 // we don't own the simulation but think we would like to
570− // --> flag the object for simulation ownership at at least POKE
571− // (the bid for simulation ownership (if any) will be sent by the physics simulation)
572− entity->upgradeScriptSimulationPriority(SCRIPT_POKE_SIMULATION_PRIORITY);
573573
574574 uint8_t desiredPriority = entity->getScriptSimulationPriority();
575575 if (desiredPriority < simulationOwner.getPriority()) {