diff options
author | wiseoldman95 <softwatt@gmx.com> | 2015-04-29 18:24:14 +0200 |
---|---|---|
committer | wiseoldman95 <softwatt@gmx.com> | 2015-05-01 12:18:47 +0200 |
commit | 1b0e21e0b270b3938b81df119d5a741a3e1e1257 (patch) | |
tree | 7caec55ca1792af1d0e3bcb7a8b44eeff65ac15f /src/Mobs/Monster.h | |
parent | Merge pull request #1924 from mc-server/BlockAreaCountNonAir (diff) | |
download | cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.gz cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.bz2 cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.lz cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.xz cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.zst cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 21ed0c25a..43861e021 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -10,11 +10,12 @@ - - class cClientHandle; class cWorld; +// Fwd: cPath +enum class ePathFinderStatus; +class cPath; @@ -61,6 +62,7 @@ public: virtual void OnRightClicked(cPlayer & a_Player) override; virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export + virtual void StopMovingToPosition(); virtual bool ReachedDestination(void); // tolua_begin @@ -162,6 +164,11 @@ protected: /** A pointer to the entity this mobile is aiming to reach */ cEntity * m_Target; + cPath * m_Path; // TODO unique ptr + ePathFinderStatus m_PathStatus; + bool m_IsFollowingPath; + /* If 0, will give up reaching the next m_Dest and will re-compute path. */ + int m_GiveUpCounter; /** Coordinates of the next position that should be reached */ Vector3d m_Destination; /** Coordinates for the ultimate, final destination. */ @@ -201,11 +208,7 @@ protected: This is based on the ultimate, final destination and the current position, as well as the traversed coordinates, and any environmental hazards */ void TickPathFinding(void); /** Finishes a pathfinding task, be it due to failure or something else */ - inline void FinishPathFinding(void) - { - m_TraversedCoordinates.clear(); - m_bMovingToDestination = false; - } + void FinishPathFinding(void); /** Sets the body yaw and head yaw/pitch based on next/ultimate destinations */ void SetPitchAndYawFromDestination(void); @@ -239,10 +242,11 @@ protected: float m_DropChanceLeggings; float m_DropChanceBoots; bool m_CanPickUpLoot; + int m_TicksSinceLastDamaged; // How many ticks ago we were last damaged by a player? void HandleDaylightBurning(cChunk & a_Chunk); + bool WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk); bool m_BurnsInDaylight; - double m_RelativeWalkSpeed; /** Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops*/ |