Skip to content

Commit 199c7b7

Browse files
authored
Make sure global damage doesn't spawn impact effects (#6842)
* check whether damage is global * use static * remove extraneous arguments
1 parent 26e9eca commit 199c7b7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

code/ship/shiphit.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,9 @@ static void ship_do_damage(object *ship_objp, object *other_obj, const vec3d *hi
24372437
shipp->ship_max_hull_strength,
24382438
};
24392439
}
2440-
maybe_play_conditional_impacts(impact_data, other_obj, ship_objp, true, submodel_num, hitpos, local_hitpos, hit_normal);
2440+
if (!global_damage) {
2441+
maybe_play_conditional_impacts(impact_data, other_obj, ship_objp, true, submodel_num, hitpos, local_hitpos, hit_normal);
2442+
}
24412443

24422444
shiphit_hit_after_death(ship_objp, (damage * difficulty_scale_factor));
24432445
return;
@@ -2681,7 +2683,9 @@ static void ship_do_damage(object *ship_objp, object *other_obj, const vec3d *hi
26812683
}
26822684
}
26832685

2684-
maybe_play_conditional_impacts(impact_data, other_obj, ship_objp, true, submodel_num, hitpos, local_hitpos, hit_normal);
2686+
if (!global_damage) {
2687+
maybe_play_conditional_impacts(impact_data, other_obj, ship_objp, true, submodel_num, hitpos, local_hitpos, hit_normal);
2688+
}
26852689

26862690
// handle weapon and afterburner leeching here
26872691
if(other_obj_is_weapon || other_obj_is_beam) {
@@ -3033,7 +3037,7 @@ void ship_apply_global_damage(object *ship_objp, object *other_obj, const vec3d
30333037

30343038
int n_quadrants = static_cast<int>(ship_objp->shield_quadrant.size());
30353039
for (int i=0; i<n_quadrants; i++){
3036-
ship_do_damage(ship_objp, other_obj, &world_hitpos, damage/n_quadrants, i, -1, damage_type_idx );
3040+
ship_do_damage(ship_objp, other_obj, &world_hitpos, damage/n_quadrants, i, -1, damage_type_idx);
30373041
}
30383042
}
30393043

0 commit comments

Comments
 (0)