summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.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/Mobs/Monster.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 '')
-rw-r--r--src/Mobs/Monster.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index ece59828e..f49175922 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -100,6 +100,7 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A
, m_RelativeWalkSpeed(1)
, m_Age(1)
, m_AgingTimer(20 * 60 * 20) // about 20 minutes
+ , m_WasLastTargetAPlayer(false)
, m_Target(nullptr)
{
if (!a_ConfigName.empty())
@@ -945,6 +946,7 @@ void cMonster::SetTarget (cPawn * a_NewTarget)
ASSERT(a_NewTarget->IsTicking());
// Notify the new target that we are now targeting it.
m_Target->TargetingMe(this);
+ m_WasLastTargetAPlayer = m_Target->IsPlayer();
}
}