summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 23:13:25 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-29 23:13:25 +0200
commit00febf68ad8bc36546c02b0c0b926189fb3955a1 (patch)
treec10896365ce99cd0e22f9398908b094ea5114e9e /src/Mobs/Monster.h
parentAgressives wander and don't crash (diff)
downloadcuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.gz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.bz2
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.lz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.xz
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.tar.zst
cuberite-00febf68ad8bc36546c02b0c0b926189fb3955a1.zip
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r--src/Mobs/Monster.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index d864f9971..47688ae91 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -5,6 +5,7 @@
#include "MonsterTypes.h"
#include "PathFinder.h"
#include "Behaviors/BehaviorWanderer.h"
+#include "MobPointer.h"
#include <vector>
class cItem;
@@ -185,14 +186,7 @@ public:
static AString MobTypeToVanillaNBT(eMonsterType a_MobType);
/** 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();
+ void SetLookingAt(cPawn * a_NewTarget);
/** Creates a new object of the specified mob.
a_MobType is the type of the mob to be created
@@ -326,10 +320,8 @@ public:
void AddRandomWeaponDropItem(cItems & a_Drops, unsigned int a_LootingLevel);
private:
- /** A pointer to the entity this mobile is aiming to reach.
- The validity of this pointer SHALL be guaranteed by the pointee;
- it MUST be reset when the pointee changes worlds or is destroyed. */
- cPawn * m_Target;
+ /** A pointer to the entity this mobile is lookingAt */
+ cMobPointer m_LookingAt;
/** Leash calculations inside Tick function */
void CalcLeashActions();