mirror of
https://github.com/overte-org/overte.git
synced 2025-08-03 23:23:38 +02:00
try different login for deciding when to update/clear simulatorID
This commit is contained in:
parent
a30e807051
commit
4677324a87
1 changed files with 4 additions and 8 deletions
|
@ -191,13 +191,11 @@ bool EntityMotionState::shouldSendUpdate(uint32_t simulationFrame) {
|
|||
QString myNodeID = nodeList->getSessionUUID().toString();
|
||||
QString simulatorID = _entity->getSimulatorID();
|
||||
|
||||
if (simulatorID.isEmpty() && _sentMoving) {
|
||||
if (simulatorID.isEmpty() && baseResult) {
|
||||
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
||||
// _entity->updateSimulatorID(myNodeID);
|
||||
simulatorID = myNodeID;
|
||||
} else if (simulatorID == myNodeID && !_sentMoving) {
|
||||
} else if (simulatorID == myNodeID && _numNonMovingUpdates > 0) {
|
||||
// we are the simulator and the object has stopped. give up "simulator" status
|
||||
// _entity->updateSimulatorID("");
|
||||
simulatorID = "";
|
||||
}
|
||||
|
||||
|
@ -262,16 +260,14 @@ void EntityMotionState::sendUpdate(OctreeEditPacketSender* packetSender, uint32_
|
|||
|
||||
|
||||
qDebug() << "EntityMotionState::sendUpdate" << _sentMoving << _body->isActive();
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
QString myNodeID = nodeList->getSessionUUID().toString();
|
||||
QString simulatorID = _entity->getSimulatorID();
|
||||
|
||||
if (simulatorID.isEmpty() && _sentMoving) {
|
||||
if (simulatorID.isEmpty()) {
|
||||
// The object is moving and nobody thinks they own the motion. set this Node as the simulator
|
||||
_entity->setSimulatorID(myNodeID);
|
||||
properties.setSimulatorID(myNodeID);
|
||||
} else if (simulatorID == myNodeID && !_sentMoving) {
|
||||
} else if (simulatorID == myNodeID && _numNonMovingUpdates > 0) {
|
||||
// we are the simulator and the object has stopped. give up "simulator" status
|
||||
_entity->setSimulatorID("");
|
||||
properties.setSimulatorID("");
|
||||
|
|
Loading…
Reference in a new issue