adjust how EntityMotionState updates its idea of what the server knows about an entity

This commit is contained in:
Seth Alves 2015-11-10 14:42:40 -08:00
parent 82bd506086
commit e067195dfe

View file

@ -86,6 +86,8 @@ void EntityMotionState::updateServerPhysicsVariables(const QUuid& sessionID) {
return; return;
} }
_serverActionData = _entity->getActionData();
if (_entity->shouldSuppressLocationEdits()) { if (_entity->shouldSuppressLocationEdits()) {
// if we send now, the changes will be ignored, so don't update our idea of what the server knows. // if we send now, the changes will be ignored, so don't update our idea of what the server knows.
return; return;
@ -96,7 +98,6 @@ void EntityMotionState::updateServerPhysicsVariables(const QUuid& sessionID) {
_serverVelocity = _entity->getVelocity(); _serverVelocity = _entity->getVelocity();
_serverAngularVelocity = _entity->getAngularVelocity(); _serverAngularVelocity = _entity->getAngularVelocity();
_serverAcceleration = _entity->getAcceleration(); _serverAcceleration = _entity->getAcceleration();
_serverActionData = _entity->getActionData();
} }
// virtual // virtual
@ -446,11 +447,13 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, const Q
} }
// remember properties for local server prediction // remember properties for local server prediction
_serverPosition = _entity->getPosition(); if (!_entity->shouldSuppressLocationEdits()) {
_serverRotation = _entity->getRotation(); _serverPosition = _entity->getPosition();
_serverVelocity = _entity->getVelocity(); _serverRotation = _entity->getRotation();
_serverAcceleration = _entity->getAcceleration(); _serverVelocity = _entity->getVelocity();
_serverAngularVelocity = _entity->getAngularVelocity(); _serverAcceleration = _entity->getAcceleration();
_serverAngularVelocity = _entity->getAngularVelocity();
}
_serverActionData = _entity->getActionData(); _serverActionData = _entity->getActionData();
EntityItemProperties properties; EntityItemProperties properties;