- Added FDARI's A_JumpIfHealthLower patch.

Now with pointer accessibility.
This commit is contained in:
MajorCooke 2014-09-26 11:48:20 -05:00
parent c5db63fbbb
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!
}

View file

@ -204,7 +204,7 @@ ACTOR Actor native //: Thinker
action native A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, int spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0);
action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0);
action native A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, bool aim = false, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0);
action native A_JumpIfHealthLower(int health, state label);
action native A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
action native A_JumpIfCloser(float distance, state label);
action native A_JumpIfTracerCloser(float distance, state label);
action native A_JumpIfMasterCloser(float distance, state label);