mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 21:23:49 +02:00
Merge pull request #1321 from HifiExperiments/lifetime
fix domain entity lifetime in serverless mode
This commit is contained in:
commit
537462ff37
2 changed files with 5 additions and 4 deletions
|
@ -705,10 +705,11 @@ void EntityTree::deleteEntitiesByID(const std::vector<EntityItemID>& ids, bool f
|
|||
entity = _entityMap.value(id);
|
||||
}
|
||||
if (entity) {
|
||||
if (entity->isDomainEntity()) {
|
||||
bool isServerless = isServerlessMode();
|
||||
if (entity->isDomainEntity() && !isServerless) {
|
||||
// domain-entity deletes must round-trip through entity-server
|
||||
domainEntitiesIDs.push_back(id);
|
||||
} else if (force || entity->isLocalEntity() || entity->isMyAvatarEntity()) {
|
||||
} else if (force || entity->isLocalEntity() || entity->isMyAvatarEntity() || isServerless) {
|
||||
entitiesToDelete.push_back(entity);
|
||||
entity->collectChildrenForDelete(entitiesToDelete, sessionID);
|
||||
}
|
||||
|
|
|
@ -186,10 +186,10 @@ void PhysicalEntitySimulation::processDeadEntities() {
|
|||
if (motionState) {
|
||||
_entitiesToRemoveFromPhysics.insert(entity);
|
||||
}
|
||||
if (entity->isDomainEntity()) {
|
||||
if (entity->isDomainEntity() && !getEntityTree()->isServerlessMode()) {
|
||||
// interface-client can't delete domainEntities outright, they must roundtrip through the entity-server
|
||||
_entityPacketSender->queueEraseEntityMessage(entity->getID());
|
||||
} else if (entity->isLocalEntity() || entity->isMyAvatarEntity()) {
|
||||
} else {
|
||||
entitiesToDeleteImmediately.push_back(entity);
|
||||
entity->collectChildrenForDelete(entitiesToDeleteImmediately, sessionID);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue