- Added Gez's GetArmorType submission

SVN r1636 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-05 20:23:47 +00:00
commit 8c3a816428
8 changed files with 51 additions and 3 deletions

View file

@ -524,6 +524,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetInventory)
DoJumpIfInventory(self->target, PUSH_PARAMINFO);
}
//==========================================================================
//
// State jump function
//
//==========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfArmorType)
{
ACTION_PARAM_START(3);
ACTION_PARAM_NAME(Type, 0);
ACTION_PARAM_STATE(JumpOffset, 1);
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
ABasicArmor * armor = (ABasicArmor *) self->FindInventory(NAME_BasicArmor);
if (armor && armor->ArmorType == Type)
ACTION_JUMP(JumpOffset);
}
//==========================================================================
//
// Parameterized version of A_Explode