summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-01 21:49:34 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-03 21:50:17 +0100
commit4aade202e006738a0baf4c3190cff8ce6b91003c (patch)
treee83b2297221f3f74360304cbb4671fa8a7079722 /src/Mobs/Monster.h
parentMerge pull request #2941 from LogicParrot/chunkBug2 (diff)
downloadcuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar.gz
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar.bz2
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar.lz
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar.xz
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.tar.zst
cuberite-4aade202e006738a0baf4c3190cff8ce6b91003c.zip
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r--src/Mobs/Monster.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 7c4683942..2155a4a7c 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -44,6 +44,10 @@ public:
*/
cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
+ ~cMonster();
+
+ virtual void Destroyed() override;
+
CLASS_PROTODEF(cMonster)
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
@@ -156,6 +160,16 @@ public:
// tolua_end
+ /** Sets the target that this mob will chase. Pass a nullptr to unset. */
+ void SetTarget (cPawn * a_NewTarget);
+
+ /** Unset the target without notifying the target entity. Do not use this, use SetTarget(nullptr) instead.
+ This is only used by cPawn internally. */
+ void UnsafeUnsetTarget();
+
+ /** Returns the current target. */
+ cPawn * GetTarget ();
+
/** Creates a new object of the specified mob.
a_MobType is the type of the mob to be created
Asserts and returns null if mob type is not specified
@@ -164,9 +178,6 @@ public:
protected:
- /** A pointer to the entity this mobile is aiming to reach */
- cEntity * m_Target;
-
/** The pathfinder instance handles pathfinding for this monster. */
cPathFinder m_PathFinder;
@@ -255,4 +266,8 @@ protected:
/** Adds weapon that is equipped with the chance saved in m_DropChance[...] (this will be greter than 1 if picked up or 0.085 + (0.01 per LootingLevel) if born with) to the drop */
void AddRandomWeaponDropItem(cItems & a_Drops, unsigned int a_LootingLevel);
+private:
+ /** A pointer to the entity this mobile is aiming to reach */
+ cPawn * m_Target;
+
} ; // tolua_export