Skip to content

Commit df69993

Browse files
authored
Merge pull request #5633 from Goober5000/tweak_weapon_detonation
fix weapon detonation
2 parents 305a7f6 + 6823e24 commit df69993

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

code/weapon/weapons.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5018,6 +5018,10 @@ void weapon_home(object *obj, int num, float frame_time)
50185018
wip = &Weapon_info[wp->weapon_info_index];
50195019
hobjp = Weapons[num].homing_object;
50205020

5021+
// don't home if we're detonating; we don't want to change target, lifetime, heading, or speed
5022+
if (wp->weapon_flags[Weapon::Weapon_Flags::Begun_detonation])
5023+
return;
5024+
50215025
//local ssms home only in stages 1 and 5
50225026
if ( (wp->lssm_stage==2) || (wp->lssm_stage==3) || (wp->lssm_stage==4))
50235027
return;
@@ -5370,6 +5374,9 @@ void weapon_home(object *obj, int num, float frame_time)
53705374

53715375
// this flag is needed so we don't prolong the missile's life by repeatedly detonating it
53725376
wp->weapon_flags.set(Weapon::Weapon_Flags::Begun_detonation);
5377+
5378+
// return so we don't change target, lifetime, heading, or speed
5379+
return;
53735380
}
53745381

53755382
// Only lead target if more than one second away. Otherwise can miss target. I think this

0 commit comments

Comments
 (0)