summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-11-07 14:26:31 +0100
committerworktycho <work.tycho@gmail.com>2015-11-07 14:26:31 +0100
commit7dae50fc14c27ba90a95e14c526a5fa976cac381 (patch)
treeacfb3eb689f7a4752e74993d93247525ac7896b3 /src/Mobs
parentMerge pull request #2617 from Gargaj/pushcomestoshove (diff)
parentdon't attack if dead (diff)
downloadcuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar.gz
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar.bz2
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar.lz
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar.xz
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.tar.zst
cuberite-7dae50fc14c27ba90a95e14c526a5fa976cac381.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/AggressiveMonster.cpp2
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();