From f5842062d3f9594d8f22f8938915194d20ebdf5f Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 13 Apr 2013 21:28:55 +0000 Subject: Proper entity removal functions git-svn-id: http://mc-server.googlecode.com/svn/trunk@1386 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/World.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/World.cpp') diff --git a/source/World.cpp b/source/World.cpp index 6e321d63a..74a7ea399 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -1722,7 +1722,7 @@ void cWorld::AddPlayer(cPlayer * a_Player) void cWorld::RemovePlayer(cPlayer * a_Player) { - m_ChunkMap->RemoveEntityFromChunk(a_Player, a_Player->GetChunkX(), a_Player->GetChunkZ()); + m_ChunkMap->RemoveEntity(a_Player); cCSLock Lock(m_CSPlayers); m_Players.remove(a_Player); } @@ -1853,15 +1853,6 @@ void cWorld::SendPlayerList(cPlayer * a_DestPlayer) -void cWorld::RemoveEntityFromChunk(cEntity * a_Entity, int a_ChunkX, int a_ChunkZ) -{ - m_ChunkMap->RemoveEntityFromChunk(a_Entity, a_ChunkX, a_ChunkZ); -} - - - - - bool cWorld::ForEachEntity(cEntityCallback & a_Callback) { return m_ChunkMap->ForEachEntity(a_Callback); @@ -2084,6 +2075,15 @@ bool cWorld::HasEntity(int a_UniqueID) +void cWorld::RemoveEntity(cEntity * a_Entity) +{ + m_ChunkMap->RemoveEntity(a_Entity); +} + + + + + unsigned int cWorld::GetNumPlayers(void) { cCSLock Lock(m_CSPlayers); -- cgit v1.2.3