summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 14:33:04 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 19:55:30 +0200
commit5e9421bba327d79f9876a5cab2882b8b89fbeef7 (patch)
tree9e9122400dc4550afb2d92654c6caaf45007091f /src/Mobs/Monster.h
parentd (diff)
downloadcuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar.gz
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar.bz2
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar.lz
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar.xz
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.tar.zst
cuberite-5e9421bba327d79f9876a5cab2882b8b89fbeef7.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 144228fe7..b123791a4 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -232,7 +232,15 @@ public:
virtual void GetFollowedItems(cItems & a_Items);
virtual void GetBreedingItems(cItems & a_Items);
-protected:
+ cPlayer * GetNearestPlayer();
+
+ protected:
+
+ /** Whether or not m_NearestPlayer is stale. Always true at the beginning of a tick.
+ When true, GetNearestPlayer() actually searches for a player, updates m_NearestPlayer, and sets it to false.
+ otherwise it returns m_NearestPlayer. This means we only perform 1 search per tick. */
+ bool m_NearestPlayerIsStale;
+ cPlayer * m_NearestPlayer;
/** The pathfinder instance handles pathfinding for this monster. */
cPathFinder m_PathFinder;