mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- Added GetCrouchFactor(ptr).
Gets the crouch factor of a player. Can be set to target/master/tracer, as long as it's a player. Defaults to the first player.
This commit is contained in:
parent
2719905ade
commit
bb91723174
2 changed files with 31 additions and 0 deletions
|
@ -483,6 +483,36 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetZAt)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// GetCrouchFactor
|
||||||
|
//
|
||||||
|
// NON-ACTION function to retrieve a player's crouching factor.
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetCrouchFactor)
|
||||||
|
{
|
||||||
|
if (numret > 0)
|
||||||
|
{
|
||||||
|
assert(ret != NULL);
|
||||||
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
|
PARAM_INT_OPT(ptr) { ptr = AAPTR_PLAYER1; }
|
||||||
|
AActor *mobj = COPY_AAPTR(self, ptr);
|
||||||
|
|
||||||
|
if (!mobj || !mobj->player)
|
||||||
|
{
|
||||||
|
ret->SetFloat(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret->SetFloat(mobj->player->crouchfactor);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// __decorate_internal_state__
|
// __decorate_internal_state__
|
||||||
|
|
|
@ -46,6 +46,7 @@ ACTOR Actor native //: Thinker
|
||||||
native float GetZAt(float px = 0, float py = 0, float angle = 0, int flags = 0, int pick_pointer = AAPTR_DEFAULT);
|
native float GetZAt(float px = 0, float py = 0, float angle = 0, int flags = 0, int pick_pointer = AAPTR_DEFAULT);
|
||||||
native int GetSpawnHealth();
|
native int GetSpawnHealth();
|
||||||
native int GetGibHealth();
|
native int GetGibHealth();
|
||||||
|
native float GetCrouchFactor(int ptr = AAPTR_PLAYER1);
|
||||||
|
|
||||||
// Action functions
|
// Action functions
|
||||||
// Meh, MBF redundant functions. Only for DeHackEd support.
|
// Meh, MBF redundant functions. Only for DeHackEd support.
|
||||||
|
|
Loading…
Reference in a new issue