From 14bba9aea1b212f927feb08a2d19a4b6b87c242d Mon Sep 17 00:00:00 2001 From: Goober5000 Date: Tue, 23 Jan 2024 00:07:33 -0500 Subject: [PATCH] fix crash in fire-beam-at-coordinates A small oversight in #5837 - beam jitter is not done when targeting coordinates. --- code/weapon/beam.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/weapon/beam.cpp b/code/weapon/beam.cpp index 188cdfab5d6..ef68a6cd827 100644 --- a/code/weapon/beam.cpp +++ b/code/weapon/beam.cpp @@ -2869,8 +2869,10 @@ void beam_aim(beam *b) b->subsys->shared_fire_direction_beam_objnum = b->objnum; } - // after pointing, jitter based on shot_aim - beam_jitter_aim(b, b->binfo.shot_aim[b->shot_index]); + // after pointing, jitter based on shot_aim (if we have a target object) + if (!(b->flags & BF_TARGETING_COORDS)) { + beam_jitter_aim(b, b->binfo.shot_aim[b->shot_index]); + } } break;