mirror of https://github.com/ZDoom/gzdoom.git
- added a GetMissileDamage function to DECORATE which can be used to properly retrieve an actor's damage value.
The damage property should be considered deprecated inside expressions from now on.
This commit is contained in:
parent
f1ba19073f
commit
3eb1af6957
|
@ -231,6 +231,38 @@ DEFINE_ACTION_FUNCTION(AActor, CheckClass)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// CheckClass
|
||||
//
|
||||
// NON-ACTION function to calculate missile damage for the given actor
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetMissileDamage)
|
||||
{
|
||||
if (numret > 0)
|
||||
{
|
||||
assert(ret != NULL);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(mask);
|
||||
PARAM_INT(add)
|
||||
PARAM_INT_OPT(pick_pointer) { pick_pointer = AAPTR_DEFAULT; }
|
||||
|
||||
self = COPY_AAPTR(self, pick_pointer);
|
||||
if (self == NULL)
|
||||
{
|
||||
ret->SetInt(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret->SetInt(self->GetMissileDamage(mask, add));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// IsPointerEqual
|
||||
|
|
|
@ -53,6 +53,7 @@ ACTOR Actor native //: Thinker
|
|||
native int CountProximity(class<Actor> classname, float distance, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native float GetSpriteAngle(int ptr = AAPTR_DEFAULT);
|
||||
native float GetSpriteRotation(int ptr = AAPTR_DEFAULT);
|
||||
native int GetMissileDamage(int mask, int add, int ptr = AAPTR_DEFAULT);
|
||||
|
||||
// Action functions
|
||||
// Meh, MBF redundant functions. Only for DeHackEd support.
|
||||
|
|
Loading…
Reference in New Issue