diff options
author | Gargaj <gargaj@conspiracy.hu> | 2015-11-07 13:48:00 +0100 |
---|---|---|
committer | Gargaj <gargaj@conspiracy.hu> | 2015-11-07 13:48:00 +0100 |
commit | 31dac0cb2e89d8b06657774a32289b7efd36c8f0 (patch) | |
tree | 8a53b9b7c6ef6fd6523ab924fe5855425e1b4bf8 /src | |
parent | Merge pull request #2611 from Gargaj/chickenfall (diff) | |
download | cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar.gz cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar.bz2 cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar.lz cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar.xz cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.tar.zst cuberite-31dac0cb2e89d8b06657774a32289b7efd36c8f0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/AggressiveMonster.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp index 65bda2dff..1355a3627 100644 --- a/src/Mobs/AggressiveMonster.cpp +++ b/src/Mobs/AggressiveMonster.cpp @@ -80,7 +80,7 @@ void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d AttackDirection(m_Target->GetPosition() + Vector3d(0, m_Target->GetHeight(), 0) - MyHeadPosition); - if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length()))) + if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length())) && (GetHealth() > 0.0)) { // Attack if reached destination, target isn't null, and have a clear line of sight to target (so won't attack through walls) StopMovingToPosition(); |