Skip to content

Commit 833d181

Browse files
authored
Merge pull request #5504 from Baezon/fix-cmeasure-single-segment-trail
Fix for countermeasures with a single segment trail
2 parents dfc716d + 691ae87 commit 833d181

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

code/cmeasure/cmeasure.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ void cmeasure_set_ship_launch_vel(object *objp, object *parent_objp, int arand)
5151

5252
objp->phys_info.max_vel.xyz.z = -25.0f;
5353
vm_vec_copy_scale(&objp->phys_info.desired_vel, &objp->orient.vec.fvec, objp->phys_info.max_vel.xyz.z );
54+
55+
// if this cmeasure has a single segment trail, let the trail know since we just changed the velocity
56+
// yeah this is hacky but that's what this function gets for CHANGING the velocity on objects with a ""CONSTANT VELOCITY""
57+
weapon* wp = &Weapons[objp->instance];
58+
if (wp->trail_ptr && wp->trail_ptr->single_segment) {
59+
wp->trail_ptr->vel[0] = objp->phys_info.vel;
60+
wp->trail_ptr->vel[1] = objp->phys_info.vel;
61+
}
5462
}
5563

5664
/**

0 commit comments

Comments
 (0)