summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-31 12:53:10 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-31 12:53:10 +0200
commit0b288fefcccc8c228044ae8319f053f5408264a1 (patch)
treee0d1bf0accec2149d5c1ece32a7b26adbdb7ac58 /src/Mobs/Monster.h
parentRemoved BehaviorStriker, and some doc (diff)
downloadcuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar.gz
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar.bz2
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar.lz
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar.xz
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.tar.zst
cuberite-0b288fefcccc8c228044ae8319f053f5408264a1.zip
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r--src/Mobs/Monster.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 1ed443aad..760edb0e9 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -221,9 +221,20 @@ public:
void AttachRightClickBehavior(cBehavior * a_Behavior);
void AttachDoTakeDamageBehavior(cBehavior * a_Behavior);
+ /** If a behavior calls this within its tick, it will be the only behavior
+ that gets to tick until UnpinBehavior is called. ControlDesired will no
+ longer be called for any tick until unpinning is done. MUST be called
+ from the tick function of a behavior. */
void PinBehavior(cBehavior * a_Behavior);
+
+ /** Unpins the behavior and ticking goes back to normal. MUST be called
+ on the same behavior pointer that called PinBehavior. */
void UnpinBehavior(cBehavior * a_Behavior);
- protected:
+
+ /** Returns a reference to this mob's pathfinder. Typically used by behaviors
+ to tweak pathfinding behavior as they gain or release control of the mob. */
+ cPathFinder & GetPathFinder();
+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.