summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
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.h
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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 1c3d9c37a..3aaadb57f 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -176,6 +176,9 @@ public:
*/
static cMonster * NewMonsterFromType(eMonsterType a_MobType);
+ /** Returns if this mob last target was a player to avoid destruction on player quit */
+ bool WasLastTargetAPlayer() const { return m_WasLastTargetAPlayer; }
+
protected:
/** The pathfinder instance handles pathfinding for this monster. */
@@ -251,6 +254,8 @@ protected:
int m_Age;
int m_AgingTimer;
+ bool m_WasLastTargetAPlayer;
+
/** Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops */
void AddRandomDropItem(cItems & a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth = 0);