diff options
Diffstat (limited to '')
-rw-r--r-- | source/cWorld.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 5bb1e8094..3c1da9945 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -1238,7 +1238,7 @@ void cWorld::Broadcast( const cPacket & a_Packet, cClientHandle * a_Exclude) { continue; } - (*itr)->GetClientHandle()->Send( a_Packet ); + ch->Send( a_Packet ); } } @@ -1264,6 +1264,24 @@ void cWorld::BroadcastToChunkOfBlock(int a_X, int a_Y, int a_Z, cPacket * a_Pack +void cWorld::BroadcastChat(const AString & a_Message, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSPlayers); + for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) + { + cClientHandle * ch = (*itr)->GetClientHandle(); + if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed()) + { + continue; + } + ch->SendChat(a_Message); + } +} + + + + + void cWorld::MarkChunkDirty (int a_ChunkX, int a_ChunkY, int a_ChunkZ) { m_ChunkMap->MarkChunkDirty (a_ChunkX, a_ChunkY, a_ChunkZ); |