feat: taking every object from one client can leave one out

DestructAllEntities takes an object to skip, for the seamless instance move that keeps the player's own ghost.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-10 15:15:16 -06:00
parent 0a0e37e96f
commit 7695445c4c
2 changed files with 4 additions and 2 deletions

View File

@@ -499,8 +499,9 @@ void EntityManager::SerializeEntity(const Entity& entity) {
}
}
void EntityManager::DestructAllEntities(const SystemAddress& sysAddr) {
void EntityManager::DestructAllEntities(const SystemAddress& sysAddr, const LWOOBJID except) {
for (auto* entity : m_Entities | std::views::values) {
if (entity && except != LWOOBJID_EMPTY && entity->GetObjectID() == except) continue;
DestructEntity(entity, sysAddr);
}
}

View File

@@ -56,7 +56,8 @@ public:
void SerializeEntity(const Entity& entity);
void ConstructAllEntities(const SystemAddress& sysAddr);
void DestructAllEntities(const SystemAddress& sysAddr);
// Takes every object away from one client, except `except` when given
void DestructAllEntities(const SystemAddress& sysAddr, LWOOBJID except = LWOOBJID_EMPTY);
void SetGhostDistanceMax(float value);
void SetGhostDistanceMin(float value);