From 19a9462fe88b2573ab9f24a2890d4affb2bdcf47 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 19 Jan 2011 18:27:50 +0100 Subject: removed double entity list in gameworld and cleaned up connected stuff --- src/game/server/entities/pickup.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/game/server/entities/pickup.cpp') diff --git a/src/game/server/entities/pickup.cpp b/src/game/server/entities/pickup.cpp index a2c6f650..136e3efe 100644 --- a/src/game/server/entities/pickup.cpp +++ b/src/game/server/entities/pickup.cpp @@ -5,7 +5,7 @@ #include "pickup.h" CPickup::CPickup(CGameWorld *pGameWorld, int Type, int SubType) -: CEntity(pGameWorld, NETOBJTYPE_PICKUP) +: CEntity(pGameWorld, CGameWorld::ENTTYPE_PICKUP) { m_Type = Type; m_Subtype = SubType; @@ -91,12 +91,9 @@ void CPickup::Tick() RespawnTime = g_pData->m_aPickups[m_Type].m_Respawntime; // loop through all players, setting their emotes - CEntity *apEnts[64]; - int Num = GameServer()->m_World.FindEntities(vec2(0, 0), 1000000, apEnts, 64, NETOBJTYPE_CHARACTER); - - for (int i = 0; i < Num; ++i) + CCharacter *pC = static_cast(GameServer()->m_World.FindFirst(CGameWorld::ENTTYPE_CHARACTER)); + for(; pC; pC = (CCharacter *)pC->TypeNext()) { - CCharacter *pC = static_cast(apEnts[i]); if (pC != pChr) pC->SetEmote(EMOTE_SURPRISE, Server()->Tick() + Server()->TickSpeed()); } -- cgit 1.4.1