Added CheckMove() function to ZScript Actor class

https://forum.zdoom.org/viewtopic.php?t=58964
This commit is contained in:
alexey.lysiuk 2018-01-02 13:04:28 +02:00
parent d8aa53f5b1
commit c4648a2b1c
3 changed files with 18 additions and 0 deletions

View file

@ -2879,6 +2879,14 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags)
return true; return true;
} }
DEFINE_ACTION_FUNCTION(AActor, CheckMove)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_INT_DEF(flags);
ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags));
}
//========================================================================== //==========================================================================

View file

@ -624,6 +624,7 @@ class Actor : Thinker native
} }
native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null); native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null);
native bool CheckMove(vector2 newpos, int flags = 0);
native void NewChaseDir(); native void NewChaseDir();
native void RandomChaseDir(); native void RandomChaseDir();
native bool CheckMissileRange(); native bool CheckMissileRange();

View file

@ -516,6 +516,15 @@ enum EWarpFlags
WARPF_COPYPITCH = 0x8000, WARPF_COPYPITCH = 0x8000,
}; };
// Flags for Actor.CheckMove()
enum ECheckMoveFlags
{
PCM_DROPOFF = 1,
PCM_NOACTORS = 1 << 1,
PCM_NOLINES = 1 << 2,
};
// flags for A_SetPitch/SetAngle/SetRoll // flags for A_SetPitch/SetAngle/SetRoll
enum EAngleFlags enum EAngleFlags
{ {