mirror of
https://github.com/overte-org/overte.git
synced 2025-08-14 16:29:40 +02:00
if an entity has no simulatorID, pull it out of list of entities with simulatorIDs
This commit is contained in:
parent
32ced31f60
commit
d90dec066c
1 changed files with 4 additions and 3 deletions
|
@ -38,10 +38,11 @@ void SimpleEntitySimulation::updateEntitiesInternal(const quint64& now) {
|
|||
itemItr = _hasSimulationOwnerEntities.begin();
|
||||
while (itemItr != _hasSimulationOwnerEntities.end()) {
|
||||
EntityItem* entity = *itemItr;
|
||||
if (!entity->getSimulatorID().isNull() &&
|
||||
usecTimestampNow() - entity->getLastChangedOnServer() >= AUTO_REMOVE_SIMULATION_OWNER_USEC) {
|
||||
if (entity->getSimulatorID().isNull()) {
|
||||
itemItr = _hasSimulationOwnerEntities.erase(itemItr);
|
||||
} else if (usecTimestampNow() - entity->getLastChangedOnServer() >= AUTO_REMOVE_SIMULATION_OWNER_USEC) {
|
||||
qCDebug(entities) << "auto-removing simulation owner" << entity->getSimulatorID();
|
||||
entity->setSimulatorID("");
|
||||
entity->setSimulatorID(QUuid());
|
||||
itemItr = _hasSimulationOwnerEntities.erase(itemItr);
|
||||
} else {
|
||||
++itemItr;
|
||||
|
|
Loading…
Reference in a new issue