History

add priority promotion to reduce volunteer races

also fix priority inheritance from chained collisions

Andrew Meadows committed 11 years ago

Commit 4d4b97f1 parent f2749589 files · +26 −46Browse files

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

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+5−3
@@ -161,9 +161,11 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, EntityItemProperties proper · 160 unmodified lines
161 // proxy toward the true physical position" feature to hide the final glitches in the remote watcher's161 // proxy toward the true physical position" feature to hide the final glitches in the remote watcher's
162 // simulation.162 // simulation.
163 163
164 // we re-assert our simulation ownership164 if (entity->getSimulationPriority() < SCRIPT_EDIT_SIMULATION_PRIORITY) {
165 properties.setSimulationOwner(myNodeID, 165 // we re-assert our simulation ownership at a higher priority
166 glm::max(entity->getSimulationPriority(), SCRIPT_EDIT_SIMULATION_PRIORITY));166 properties.setSimulationOwner(myNodeID,
167 glm::max(entity->getSimulationPriority(), SCRIPT_EDIT_SIMULATION_PRIORITY));
168 }
167 } else {169 } else {
168 // we make a bid for simulation ownership170 // we make a bid for simulation ownership
169 properties.setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATION_PRIORITY);171 properties.setSimulationOwner(myNodeID, SCRIPT_EDIT_SIMULATION_PRIORITY);