diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-02 18:51:32 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-02 18:51:32 +0200 |
commit | afb65224879ccced98c5a3699f7732dc37fe3f40 (patch) | |
tree | e2b95d4acd2b4516f8244abd0e049a33aed6a293 /src/Mobs/Behaviors/BehaviorAttacker.cpp | |
parent | d (diff) | |
download | cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar.gz cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar.bz2 cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar.lz cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar.xz cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.tar.zst cuberite-afb65224879ccced98c5a3699f7732dc37fe3f40.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorAttacker.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorAttacker.cpp b/src/Mobs/Behaviors/BehaviorAttacker.cpp index 50ce8f6ad..dd3b48de2 100644 --- a/src/Mobs/Behaviors/BehaviorAttacker.cpp +++ b/src/Mobs/Behaviors/BehaviorAttacker.cpp @@ -15,6 +15,7 @@ cBehaviorAttacker::cBehaviorAttacker() : , m_AttackCoolDownTicksLeft(0) , m_IsStriking(false) , m_Target(nullptr) + , m_ShouldRetaliate(true) { } @@ -130,6 +131,11 @@ void cBehaviorAttacker::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chun void cBehaviorAttacker::DoTakeDamage(TakeDamageInfo & a_TDI) { + if (!m_ShouldRetaliate) + { + return; + } + if ((a_TDI.Attacker != nullptr) && a_TDI.Attacker->IsPawn()) { if ( |