- Added FDARI's A_JumpIfHealthLower patch.

Now with pointer accessibility.
This commit is contained in:
MajorCooke 2014-09-26 11:48:20 -05:00
commit 5b71ce6dcb
2 changed files with 11 additions and 3 deletions

View file

@ -601,11 +601,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump)
//==========================================================================
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHealthLower)
{
ACTION_PARAM_START(2);
ACTION_PARAM_START(3);
ACTION_PARAM_INT(health, 0);
ACTION_PARAM_STATE(jump, 1);
ACTION_PARAM_INT(ptr_selector, 2);
if (self->health < health) ACTION_JUMP(jump);
AActor *measured;
measured = COPY_AAPTR(self, ptr_selector);
if (measured && measured->health < health)
{
ACTION_JUMP(jump);
}
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
}