summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-05-07 22:58:02 +0200
committerworktycho <work.tycho@gmail.com>2015-05-07 22:58:02 +0200
commit011126293b42efad5ccbef912c44418c2437cf78 (patch)
tree278caa29a65bfab2b7a5079adec772c701c11976 /src/Mobs/Monster.h
parentMerge pull request #1951 from mc-server/BroadcastRefactor (diff)
parentAI - Safer WouldBurnAt() (diff)
downloadcuberite-011126293b42efad5ccbef912c44418c2437cf78.tar
cuberite-011126293b42efad5ccbef912c44418c2437cf78.tar.gz
cuberite-011126293b42efad5ccbef912c44418c2437cf78.tar.bz2
cuberite-011126293b42efad5ccbef912c44418c2437cf78.tar.lz
cuberite-011126293b42efad5ccbef912c44418c2437cf78.tar.xz
cuberite-011126293b42efad5ccbef912c44418c2437cf78.tar.zst
cuberite-011126293b42efad5ccbef912c44418c2437cf78.zip
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r--src/Mobs/Monster.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index c7f38c9f7..a2295777a 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -203,8 +203,18 @@ protected:
Returns if a path is ready, and therefore if the mob should move to m_NextWayPointPosition
*/
bool TickPathFinding(cChunk & a_Chunk);
+
+ /** Move in a straight line to the next waypoint in the path, will jump if needed. */
void MoveToWayPoint(cChunk & a_Chunk);
+ /** Ensures the destination is not buried underground or under water. Also ensures the destination is not in the air.
+ Only the Y coordinate of m_FinalDestination might be changed.
+ 1. If m_FinalDestination is the position of a water block, m_FinalDestination's Y will be modified to point to the heighest water block in the pool in the current column.
+ 2. If m_FinalDestination is the position of a solid, m_FinalDestination's Y will be modified to point to the first airblock above the solid in the current column.
+ 3. If m_FinalDestination is the position of an air block, Y will keep decreasing until hitting either a solid or water.
+ Now either 1 or 2 is performed. */
+ bool EnsureProperDestination(cChunk & a_Chunk);
+
/** Resets a pathfinding task, be it due to failure or something else
Resets the pathfinder. If m_IsFollowingPath is true, TickPathFinding starts a brand new path.
Should only be called by the pathfinder, cMonster::Tick or StopMovingToPosition. */