- 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)
This commit is contained in:
Randy Heit 2013-01-06 04:15:28 +00:00
parent 0d47c6cbc8
commit 7fb0d37d99
2 changed files with 8 additions and 5 deletions

View file

@ -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->target == NULL || self->target->health <= 0)
{ {
if (self->MissileState && pr_m_refire() < 160) if (self->MissileState && pr_m_refire() < 160)
@ -167,7 +170,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_Refire)
self->SetState (self->state + 1); self->SetState (self->state + 1);
return; return;
} }
if ((self->MissileState == NULL && !self->CheckMeleeRange ()) || if (((ignoremissile || self->MissileState == NULL) && !self->CheckMeleeRange ()) ||
!P_CheckSight (self, self->target) || !P_CheckSight (self, self->target) ||
pr_m_refire() < 4) // Small chance of stopping even when target not dead pr_m_refire() < 4) // Small chance of stopping even when target not dead
{ {

View file

@ -18,7 +18,7 @@ ACTOR ScriptedMarine 9100 native
DeathSound "*death" DeathSound "*death"
PainSound "*pain50" PainSound "*pain50"
action native A_M_Refire (); action native A_M_Refire (bool ignoremissile=false);
action native A_M_CheckAttack (); action native A_M_CheckAttack ();
action native A_MarineChase (); action native A_MarineChase ();
action native A_MarineLook (); action native A_MarineLook ();
@ -57,7 +57,7 @@ ACTOR ScriptedMarine 9100 native
PLAY E 4 A_FaceTarget PLAY E 4 A_FaceTarget
PLAY F 4 A_M_Punch(1) PLAY F 4 A_M_Punch(1)
PLAY A 9 PLAY A 9
PLAY A 0 A_M_Refire PLAY A 0 A_M_Refire(1)
Loop Loop
PLAY A 5 A_FaceTarget PLAY A 5 A_FaceTarget
Goto See Goto See
@ -65,7 +65,7 @@ ACTOR ScriptedMarine 9100 native
PLAY E 4 A_FaceTarget PLAY E 4 A_FaceTarget
PLAY F 4 A_M_Punch(10) PLAY F 4 A_M_Punch(10)
PLAY A 9 PLAY A 9
PLAY A 0 A_M_Refire PLAY A 0 A_M_Refire(1)
Loop Loop
PLAY A 5 A_FaceTarget PLAY A 5 A_FaceTarget
Goto See Goto See