Added A_CheckSpecies(state jump, name species, ptr = AAPTR_DEFAULT)

- Performs a state jump if the defined species name for the pointed actor matches the criteria.
This commit is contained in:
MajorCooke 2015-11-26 01:33:02 -06:00
commit d730b06da7
2 changed files with 26 additions and 0 deletions

View file

@ -5028,6 +5028,31 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive)
ACTION_SET_RESULT(given);
}
//===========================================================================
//
// A_CheckSpecies
//
//===========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSpecies)
{
ACTION_PARAM_START(3);
ACTION_PARAM_STATE(jump, 0);
ACTION_PARAM_NAME(species, 1);
ACTION_PARAM_INT(ptr, 2);
AActor *mobj = COPY_AAPTR(self, ptr);
ACTION_SET_RESULT(false);
//Needs at least one state jump to work.
if (!mobj)
{
return;
}
if (jump && mobj->GetSpecies() == species)
ACTION_JUMP(jump);
}
//==========================================================================
//