Skip to content

Commit dde16a5

Browse files
committed
restore inadvertently deleted code
This has an interesting history. In the original Volition source release, global damage was set to originate from the shockwave position, which would have avoided the fireball issue fixed by scp-fs2open#6882. (Technically, though, this was only done for huge ships which would have still left the problem for smaller ships.) In c2716d4, this code was changed to run in non-HTL mode in an attempt to fix a bug. Then in 70529db, as part of the removal of non-HTL mode, the code was entirely deleted. So, this restores the code. The scp-fs2open#6882 fix is still valid, both because it works for non-huge ships, and because shockwaves may not necessarily originate from the subobject being destroyed. The scp-fs2open#6882 fix also subsumes the effect of the restored code, but it's still good to restore the code in case future development may depend on it.
1 parent 85b37e0 commit dde16a5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

code/ship/shiphit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3080,6 +3080,11 @@ void ship_apply_global_damage(object *ship_objp, object *other_obj, const vec3d
30803080
// shield_quad = quadrant facing the force_center
30813081
shield_quad = get_quadrant(&local_hitpos, ship_objp);
30823082

3083+
// world_hitpos use force_center for shockwave
3084+
// Goober5000 check for NULL
3085+
if (other_obj && (other_obj->type == OBJ_SHOCKWAVE) && (Ship_info[Ships[ship_objp->instance].ship_info_index].is_huge_ship()))
3086+
world_hitpos = *force_center;
3087+
30833088
int wip_index = -1;
30843089
if(other_obj != nullptr && other_obj->type == OBJ_SHOCKWAVE)
30853090
wip_index = shockwave_get_weapon_index(other_obj->instance);

0 commit comments

Comments
 (0)