summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 447e2cf25..d4be3addb 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -1149,8 +1149,8 @@ void cWorld::TickMobs(std::chrono::milliseconds a_Dt)
{
Monster->Tick(m_Dt, *(a_Entity->GetParentChunk()));
}
- // Destroy far hostile mobs
- else if ((Monster->GetMobFamily() == cMonster::eFamily::mfHostile))
+ // Destroy far hostile mobs except if last target was a player
+ else if ((Monster->GetMobFamily() == cMonster::eFamily::mfHostile) && !Monster->WasLastTargetAPlayer())
{
if (Monster->GetMobType() != eMonsterType::mtWolf)
{