diff --git a/src/game/server/gameworld.cpp b/src/game/server/gameworld.cpp index 7a511c9ebd0..d0352b2c99c 100644 --- a/src/game/server/gameworld.cpp +++ b/src/game/server/gameworld.cpp @@ -6,6 +6,7 @@ #include "entity.h" #include "gamecontext.h" #include "gamecontroller.h" +#include "player.h" #include @@ -214,13 +215,12 @@ void CGameWorld::Tick() if(GameServer()->m_pController->IsForceBalanced()) GameServer()->SendChat(-1, TEAM_ALL, "Teams have been balanced"); - // This is placed here so that certain weapon physics can happen before the regular Charecter Tick() to preserve physics accuracy - auto *pChar = m_apFirstEntityTypes[ENTTYPE_CHARACTER]; - for(; pChar;) + // This is placed here so that certain weapon physics can happen before the regular Charecter Tick() to preserve physics accuracy. + // It is done in client order to preserve previous behavior. + for(auto &m_apPlayer : GameServer()->m_apPlayers) { - m_pNextTraverseEntity = pChar->m_pNextTypeEntity; - ((CCharacter *)pChar)->WeaponTick(); - pChar = m_pNextTraverseEntity; + CCharacter *pChar = m_apPlayer->GetCharacter(); + pChar->WeaponTick(); } // update all objects