Added GetProximity(classname, distance, flags, ptr).
- Behaves similarly to A_CheckProximity but returns the count of classname instead of true/false. # Conflicts: # wadsrc/static/actors/actor.txt
This commit is contained in:
parent
d0b953cbb7
commit
167cb28563
4 changed files with 51 additions and 16 deletions
|
|
@ -643,6 +643,38 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetPlayerInput)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// GetProximity
|
||||
//
|
||||
// NON-ACTION function of A_CheckProximity that returns how much it counts.
|
||||
// Takes a pointer as anyone may or may not be a player.
|
||||
//==========================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetProximity)
|
||||
{
|
||||
if (numret > 0)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_CLASS(classname, AActor);
|
||||
PARAM_FLOAT(distance);
|
||||
PARAM_INT_OPT(flags) { flags = 0; }
|
||||
PARAM_INT_OPT(ptr) { ptr = AAPTR_DEFAULT; }
|
||||
|
||||
AActor *mobj = COPY_AAPTR(self, ptr);
|
||||
if (mobj == nullptr)
|
||||
{
|
||||
ret->SetInt(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret->SetInt(P_Thing_CheckProximity(self, classname, distance, 0, flags, ptr, true));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// __decorate_internal_state__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue