diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 16:52:30 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-08 16:52:30 +0200 |
commit | 40503ab8912c21c8f7913b190fcf835dd8ad18d1 (patch) | |
tree | 5ec63036a2c852704a92e8ce1b3f111a13ed8d0a /src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp | |
parent | merge (diff) | |
download | cuberite-mobs2.tar cuberite-mobs2.tar.gz cuberite-mobs2.tar.bz2 cuberite-mobs2.tar.lz cuberite-mobs2.tar.xz cuberite-mobs2.tar.zst cuberite-mobs2.zip |
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp b/src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp index 843cc58ef..5120e4a57 100644 --- a/src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp +++ b/src/Mobs/Behaviors/BehaviorAttackerSuicideBomber.cpp @@ -9,10 +9,11 @@ -cBehaviorAttackerSuicideBomber::cBehaviorAttackerSuicideBomber() : +cBehaviorAttackerSuicideBomber::cBehaviorAttackerSuicideBomber(bool a_ShouldBroadcastEntityMetadata) : m_bIsBlowing(false), m_bIsCharged(false), - m_BurnedWithFlintAndSteel(false) + m_BurnedWithFlintAndSteel(false), + m_ShouldBroadcastEntityMetadata(a_ShouldBroadcastEntityMetadata) { } @@ -42,8 +43,10 @@ bool cBehaviorAttackerSuicideBomber::DoStrike(int a_StrikeTickCnt) m_Parent->GetWorld()->BroadcastSoundEffect("entity.creeper.primed", m_Parent->GetPosX(), m_Parent->GetPosY(), m_Parent->GetPosZ(), 1.f, (0.75f + (static_cast<float>((m_Parent->GetUniqueID() * 23) % 32)) / 64)); m_bIsBlowing = true; - m_Parent->GetWorld()->BroadcastEntityMetadata(*m_Parent); - + if (m_ShouldBroadcastEntityMetadata) + { + m_Parent->GetWorld()->BroadcastEntityMetadata(*m_Parent); + } return false; } @@ -51,7 +54,10 @@ bool cBehaviorAttackerSuicideBomber::DoStrike(int a_StrikeTickCnt) if (((GetTarget() == nullptr) || (!TargetIsInStrikeRadius())) && (!m_BurnedWithFlintAndSteel)) { m_bIsBlowing = false; - m_Parent->GetWorld()->BroadcastEntityMetadata(*m_Parent); + if (m_ShouldBroadcastEntityMetadata) + { + m_Parent->GetWorld()->BroadcastEntityMetadata(*m_Parent); + } return true; } |