summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Behaviors/BehaviorAggressive.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
commit7f7c743204bb7fddfd439bcfa84943ba0fe31755 (patch)
treeacd72b62c5bc33dbb45b9ac1b5853f9970d7a45c /src/Mobs/Behaviors/BehaviorAggressive.cpp
parenttargetStrikeRange (diff)
downloadcuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.gz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.bz2
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.lz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.xz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.zst
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.zip
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorAggressive.cpp')
-rw-r--r--src/Mobs/Behaviors/BehaviorAggressive.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorAggressive.cpp b/src/Mobs/Behaviors/BehaviorAggressive.cpp
index ccea67eb4..b55c1b476 100644
--- a/src/Mobs/Behaviors/BehaviorAggressive.cpp
+++ b/src/Mobs/Behaviors/BehaviorAggressive.cpp
@@ -34,5 +34,6 @@ void cBehaviorAggressive::PreTick(std::chrono::milliseconds a_Dt, cChunk & a_Chu
cPawn * cBehaviorAggressive::FindNewTarget()
{
cPlayer * Closest = m_Parent->GetNearestPlayer();
+ if (!Closest->CanMobsTarget()) return nullptr;
return Closest; // May be null
}