From 1f109febbaae43612c8f47058055ce3b101b3b12 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 18 Dec 2016 18:31:44 +0000 Subject: test --- src/Broadcaster.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Broadcaster.cpp') diff --git a/src/Broadcaster.cpp b/src/Broadcaster.cpp index 594d12208..77091ff1c 100644 --- a/src/Broadcaster.cpp +++ b/src/Broadcaster.cpp @@ -15,13 +15,14 @@ void cBroadcaster::BroadcastParticleEffect(const AString & a_ParticleName, const m_World->DoWithChunkAt(a_Src, [=](cChunk & a_Chunk) -> bool { - for (auto && client : a_Chunk.GetAllClients()) + for (const auto & ClientHandle : a_Chunk.GetAllStrongClientPtrs()) { - if (client == a_Exclude) + if (ClientHandle.get() == a_Exclude) { continue; } - client->SendParticleEffect(a_ParticleName, a_Src.x, a_Src.y, a_Src.z, a_Offset.x, a_Offset.y, a_Offset.z, a_ParticleData, a_ParticleAmount); + + ClientHandle->SendParticleEffect(a_ParticleName, a_Src.x, a_Src.y, a_Src.z, a_Offset.x, a_Offset.y, a_Offset.z, a_ParticleData, a_ParticleAmount); }; return true; }); @@ -33,13 +34,14 @@ void cBroadcaster::BroadcastParticleEffect(const AString & a_ParticleName, const m_World->DoWithChunkAt(a_Src, [=](cChunk & a_Chunk) -> bool { - for (auto && client : a_Chunk.GetAllClients()) + for (const auto & ClientHandle : a_Chunk.GetAllStrongClientPtrs()) { - if (client == a_Exclude) + if (ClientHandle.get() == a_Exclude) { continue; } - client->SendParticleEffect(a_ParticleName, a_Src, a_Offset, a_ParticleData, a_ParticleAmount, a_Data); + + ClientHandle->SendParticleEffect(a_ParticleName, a_Src, a_Offset, a_ParticleData, a_ParticleAmount, a_Data); }; return true; }); -- cgit v1.2.3