diff options
author | wiseoldman95 <softwatt@gmx.com> | 2015-05-06 16:23:07 +0200 |
---|---|---|
committer | wiseoldman95 <softwatt@gmx.com> | 2015-05-06 16:23:07 +0200 |
commit | b8aa38b18d7f7ab78766d2be94e8738e503bacca (patch) | |
tree | 63b42769a71a3107a10ecde5c8b3c45fa63aef0d /src/Mobs/Monster.h | |
parent | Merge pull request #1946 from SafwatHalaby/lean (diff) | |
download | cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar.gz cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar.bz2 cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar.lz cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar.xz cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.tar.zst cuberite-b8aa38b18d7f7ab78766d2be94e8738e503bacca.zip |
Diffstat (limited to 'src/Mobs/Monster.h')
-rw-r--r-- | src/Mobs/Monster.h | 10 |
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. */ |