From bdea8706d8050ba3ea00b580bba795bc468cfdbd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 17 Apr 2014 18:50:25 +0100 Subject: Added new AI rules + Added new AI rules handling cacti and large heights * Fixed cIniFile not recognising comments in cIniFile::ReadFile() * Fixed users.ini not being properly generated * Changed all instances of (int)floor(GetPosXXX()) to POSXXX_TOINT --- src/Mobs/Monster.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Mobs/Monster.h') diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 776426a0d..70b3783fc 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -185,14 +185,14 @@ protected: inline bool IsNextYPosReachable(int a_PosY) { return ( - (a_PosY <= (int)floor(GetPosY())) || + (a_PosY <= POSY_TOINT) || DoesPosYRequireJump(a_PosY) ); } /** Returns if a monster can reach a given height by jumping */ inline bool DoesPosYRequireJump(int a_PosY) { - return ((a_PosY > (int)floor(GetPosY())) && (a_PosY == (int)floor(GetPosY()) + 1)); + return ((a_PosY > POSY_TOINT) && (a_PosY == POSY_TOINT + 1)); } /** A semi-temporary list to store the traversed coordinates during active pathfinding so we don't visit them again */ -- cgit v1.2.3