Skip to content

Commit c26b0ca

Browse files
authored
Ensure Aspect_invulnerability_fix always works (#6879)
#6248 added an extra subtraction line to calculating when a bomb can be shot down `extra_buggy_time`, but that value should only be calculated if `Aspect_invulnerability_fix` is off. Specifically, the `else if` checks on lines 79 and 97 of `collideweaponweapon.cpp` were getting hit even when `Aspect_invulnerability_fix` was enabled, so ensure that if that flag is on that it correctly keeps the `extra_buggy_time` at 0. Fix works as expected, happy to edit or tune however.
1 parent 85ebd31 commit c26b0ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/object/collideweaponweapon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int collide_weapon_weapon( obj_pair * pair )
6969

7070
// the erroneous extra time a bomb stays invulnerable without the fix
7171
float extra_buggy_time = 0.0f;
72-
if (wipA->is_locked_homing())
72+
if (!(The_mission.ai_profile->flags[AI::Profile_Flags::Aspect_invulnerability_fix]) && wipA->is_locked_homing())
7373
extra_buggy_time = (wipA->lifetime * LOCKED_HOMING_EXTENDED_LIFE_FACTOR) - wipA->lifetime;
7474

7575
if ((The_mission.ai_profile->flags[AI::Profile_Flags::Aspect_invulnerability_fix]) && (wipA->is_locked_homing()) && (wpA->homing_object != &obj_used_list)) {
@@ -87,7 +87,7 @@ int collide_weapon_weapon( obj_pair * pair )
8787

8888
// the erroneous extra time a bomb stays invulnerable without the fix
8989
float extra_buggy_time = 0.0f;
90-
if (wipB->is_locked_homing())
90+
if (!(The_mission.ai_profile->flags[AI::Profile_Flags::Aspect_invulnerability_fix]) && wipB->is_locked_homing())
9191
extra_buggy_time = (wipB->lifetime * LOCKED_HOMING_EXTENDED_LIFE_FACTOR) - wipB->lifetime;
9292

9393
if ((The_mission.ai_profile->flags[AI::Profile_Flags::Aspect_invulnerability_fix]) && (wipB->is_locked_homing()) && (wpB->homing_object != &obj_used_list)) {

0 commit comments

Comments
 (0)