From e82bc4b91caca143d7fbedb4b64fc358f5b19cfd Mon Sep 17 00:00:00 2001 From: SirLynix Date: Sun, 10 Nov 2024 23:42:23 +0100 Subject: [PATCH] Server/Visibility: Fix entity deletion not removing entity from environment --- src/ServerLib/SessionVisibilityHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ServerLib/SessionVisibilityHandler.cpp b/src/ServerLib/SessionVisibilityHandler.cpp index 96ab069..9ca64fb 100644 --- a/src/ServerLib/SessionVisibilityHandler.cpp +++ b/src/ServerLib/SessionVisibilityHandler.cpp @@ -397,6 +397,9 @@ namespace tsom Nz::UInt32 entityId = Nz::Retrieve(m_entityIndices, handle); deletePacket.entities.push_back(entityId); + auto& entityEnv = m_visibleEnvironments[m_visibleEntities[entityId].envIndex]; + entityEnv.entities.Reset(entityId); + m_freeEntityIds.Set(entityId, true); m_visibleEntities[entityId].entity = entt::handle{}; m_visibleEntities[entityId].envIndex = Nz::MaxValue();