1
0

Added generic entity-collecting.

Now any cEntity can be collected, not only cPickups.
This should help PR #1098.
This commit is contained in:
Mattes D
2014-06-27 20:56:29 +02:00
parent fb5d88b17e
commit 9926abd4f5
17 changed files with 36 additions and 25 deletions

View File

@@ -419,16 +419,16 @@ void cChunkMap::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSeriali
void cChunkMap::BroadcastCollectPickup(const cPickup & a_Pickup, const cPlayer & a_Player, const cClientHandle * a_Exclude)
void cChunkMap::BroadcastCollectEntity(const cEntity & a_Entity, const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
cCSLock Lock(m_CSLayers);
cChunkPtr Chunk = GetChunkNoGen(a_Pickup.GetChunkX(), ZERO_CHUNK_Y, a_Pickup.GetChunkZ());
cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), ZERO_CHUNK_Y, a_Entity.GetChunkZ());
if (Chunk == NULL)
{
return;
}
// It's perfectly legal to broadcast packets even to invalid chunks!
Chunk->BroadcastCollectPickup(a_Pickup, a_Player, a_Exclude);
Chunk->BroadcastCollectEntity(a_Entity, a_Player, a_Exclude);
}