summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorPablo Beltrán <spekdrum@gmail.com>2017-05-21 10:29:06 +0200
committerMattes D <github@xoft.cz>2017-05-21 10:29:06 +0200
commit2359611c57edc70f68b1ba05bb87dbf9c3bbc11d (patch)
treec7f56d7a6b7916fae6228cdec65b5b57dd0bb8d7 /src/World.cpp
parentUpdate submodule tolua++ (diff)
downloadcuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar.gz
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar.bz2
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar.lz
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar.xz
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.tar.zst
cuberite-2359611c57edc70f68b1ba05bb87dbf9c3bbc11d.zip
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)
{