From 691ae8752e4001e96cd7a799304b3a1fe68b37ce Mon Sep 17 00:00:00 2001 From: Asteroth Date: Thu, 20 Jul 2023 23:42:35 -0400 Subject: [PATCH] fix for countermeasures with a single segment trail --- code/cmeasure/cmeasure.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/cmeasure/cmeasure.cpp b/code/cmeasure/cmeasure.cpp index a74600febc9..43e2218fc8b 100644 --- a/code/cmeasure/cmeasure.cpp +++ b/code/cmeasure/cmeasure.cpp @@ -51,6 +51,14 @@ void cmeasure_set_ship_launch_vel(object *objp, object *parent_objp, int arand) objp->phys_info.max_vel.xyz.z = -25.0f; vm_vec_copy_scale(&objp->phys_info.desired_vel, &objp->orient.vec.fvec, objp->phys_info.max_vel.xyz.z ); + + // if this cmeasure has a single segment trail, let the trail know since we just changed the velocity + // yeah this is hacky but that's what this function gets for CHANGING the velocity on objects with a ""CONSTANT VELOCITY"" + weapon* wp = &Weapons[objp->instance]; + if (wp->trail_ptr && wp->trail_ptr->single_segment) { + wp->trail_ptr->vel[0] = objp->phys_info.vel; + wp->trail_ptr->vel[1] = objp->phys_info.vel; + } } /**