From 429c896e33f5f5d3006d181e3f573046d184f520 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sat, 7 Nov 2015 21:57:32 +0100 Subject: Only send creeper updates when there is a change Otherwise this keeps spamming the metadata packet for all the creepers on the server. --- src/Mobs/Creeper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Creeper.cpp b/src/Mobs/Creeper.cpp index 30bd41f13..353d0f009 100644 --- a/src/Mobs/Creeper.cpp +++ b/src/Mobs/Creeper.cpp @@ -29,9 +29,12 @@ void cCreeper::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) if (!TargetIsInRange() && !m_BurnedWithFlintAndSteel) { - m_ExplodingTimer = 0; - m_bIsBlowing = false; - m_World->BroadcastEntityMetadata(*this); + if (m_bIsBlowing) + { + m_ExplodingTimer = 0; + m_bIsBlowing = false; + m_World->BroadcastEntityMetadata(*this); + } } else { -- cgit v1.2.3