- fixed some incomplete checks for static arrays.

- made AActor::OkaytoSwitchTarget scripted virtual.
This commit is contained in:
Christoph Oelckers 2017-03-15 01:39:59 +01:00
commit 64bdc8c495
4 changed files with 31 additions and 4 deletions

View file

@ -1682,8 +1682,13 @@ DEFINE_ACTION_FUNCTION(AActor, PoisonMobj)
return 0;
}
//==========================================================================
//
// OkayToSwitchTarget
//
//==========================================================================
bool AActor::OkayToSwitchTarget (AActor *other)
bool AActor::OkayToSwitchTarget(AActor *other)
{
if (other == this)
return false; // [RH] Don't hate self (can happen when shooting barrels)
@ -1743,6 +1748,27 @@ bool AActor::OkayToSwitchTarget (AActor *other)
return true;
}
DEFINE_ACTION_FUNCTION(AActor, OkayToSwitchTarget)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(other, AActor);
ACTION_RETURN_BOOL(self->OkayToSwitchTarget(other));
}
bool AActor::CallOkayToSwitchTarget(AActor *other)
{
IFVIRTUAL(AActor, OkayToSwitchTarget)
{
VMValue params[] = { (DObject*)this, other };
int retv;
VMReturn ret(&retv);
GlobalVMStack.Call(func, params, 2, &ret, 1);
return !!retv;
}
return false;
}
//==========================================================================
//
// P_PoisonPlayer - Sets up all data concerning poisoning