Proper entity removal functions
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1386 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
+10
-10
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user