From ae6bb9763dc99f0206b43581be0fbf4e50bced7a Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Wed, 3 Nov 2021 18:07:25 +0100 Subject: [PATCH] Fix characters disappearing (fixes #4285) --- src/game/server/gameworld.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/game/server/gameworld.cpp b/src/game/server/gameworld.cpp index e7f5554db..c61a40ebe 100644 --- a/src/game/server/gameworld.cpp +++ b/src/game/server/gameworld.cpp @@ -106,13 +106,25 @@ void CGameWorld::RemoveEntity(CEntity *pEnt) // void CGameWorld::Snap(int SnappingClient) { - for(auto *pEnt : m_apFirstEntityTypes) - for(; pEnt;) + for(CEntity *pEnt = m_apFirstEntityTypes[ENTTYPE_CHARACTER]; pEnt;) + { + m_pNextTraverseEntity = pEnt->m_pNextTypeEntity; + pEnt->Snap(SnappingClient); + pEnt = m_pNextTraverseEntity; + } + + for(int i = 0; i < NUM_ENTTYPES; i++) + { + if(i == ENTTYPE_CHARACTER) + continue; + + for(CEntity *pEnt = m_apFirstEntityTypes[i]; pEnt;) { m_pNextTraverseEntity = pEnt->m_pNextTypeEntity; pEnt->Snap(SnappingClient); pEnt = m_pNextTraverseEntity; } + } } void CGameWorld::Reset()