set correct _bidPriority on first ownership update

This commit is contained in:
Andrew Meadows 2018-03-29 13:59:42 -07:00
parent 5a5376c3d5
commit a924bd4eb0
3 changed files with 9 additions and 0 deletions

View file

@ -710,6 +710,10 @@ uint8_t EntityMotionState::getSimulationPriority() const {
return _entity->getSimulationPriority();
}
void EntityMotionState::slaveBidPriority() {
upgradeBidPriority(_entity->getSimulationPriority());
}
// virtual
QUuid EntityMotionState::getSimulatorID() const {
assert(entityTreeIsLocked());

View file

@ -101,6 +101,10 @@ protected:
// changes _bidPriority only if priority is larger
void upgradeBidPriority(uint8_t priority);
// upgradeBidPriority to value stored in _entity
void slaveBidPriority();
void clearObjectVelocities() const;
#ifdef WANT_DEBUG_ENTITY_TREE_LOCKS

View file

@ -358,6 +358,7 @@ void PhysicalEntitySimulation::sendOwnershipBids(uint32_t numSubsteps) {
// in the EntityMotionState::_serverFoo variables (please see comments in EntityMotionState.h)
// therefore we need to immediately send an update so that the values stored are what we're
// "telling" the server rather than what we've been "hearing" from the server.
_bids[i]->slaveBidPriority();
_bids[i]->sendUpdate(_entityPacketSender, numSubsteps);
addOwnership(_bids[i]);