From 7fb0d37d99d90792f3e106db6ac4ffead2dfc914 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 6 Jan 2013 04:15:28 +0000 Subject: [PATCH] - Added a flag to A_M_Refire to ignore the actor's missile state, so the rocket marine will not continue to punch air if it starts attacking while its target is in melee range and then moves out of it. SVN r4021 (trunk) --- src/g_doom/a_scriptedmarine.cpp | 7 +++++-- wadsrc/static/actors/doom/scriptedmarine.txt | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index 3d994f502..be39b545b 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -153,8 +153,11 @@ void AScriptedMarine::Tick () // //============================================================================ -DEFINE_ACTION_FUNCTION(AActor, A_M_Refire) +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Refire) { + ACTION_PARAM_START(1); + ACTION_PARAM_BOOL(ignoremissile, 0); + if (self->target == NULL || self->target->health <= 0) { if (self->MissileState && pr_m_refire() < 160) @@ -167,7 +170,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_Refire) self->SetState (self->state + 1); return; } - if ((self->MissileState == NULL && !self->CheckMeleeRange ()) || + if (((ignoremissile || self->MissileState == NULL) && !self->CheckMeleeRange ()) || !P_CheckSight (self, self->target) || pr_m_refire() < 4) // Small chance of stopping even when target not dead { diff --git a/wadsrc/static/actors/doom/scriptedmarine.txt b/wadsrc/static/actors/doom/scriptedmarine.txt index f855fcc52..7602405c7 100644 --- a/wadsrc/static/actors/doom/scriptedmarine.txt +++ b/wadsrc/static/actors/doom/scriptedmarine.txt @@ -18,7 +18,7 @@ ACTOR ScriptedMarine 9100 native DeathSound "*death" PainSound "*pain50" - action native A_M_Refire (); + action native A_M_Refire (bool ignoremissile=false); action native A_M_CheckAttack (); action native A_MarineChase (); action native A_MarineLook (); @@ -57,7 +57,7 @@ ACTOR ScriptedMarine 9100 native PLAY E 4 A_FaceTarget PLAY F 4 A_M_Punch(1) PLAY A 9 - PLAY A 0 A_M_Refire + PLAY A 0 A_M_Refire(1) Loop PLAY A 5 A_FaceTarget Goto See @@ -65,7 +65,7 @@ ACTOR ScriptedMarine 9100 native PLAY E 4 A_FaceTarget PLAY F 4 A_M_Punch(10) PLAY A 9 - PLAY A 0 A_M_Refire + PLAY A 0 A_M_Refire(1) Loop PLAY A 5 A_FaceTarget Goto See