summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorAttacker.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Mobs/Behaviors/BehaviorAttacker.cpp6
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 (