Skip to content

Commit 17c6b7c

Browse files
committed
Merge pull request #528 from ln-zookeeper/master
Fixed $Acceleration Time not working right on non-homing secondaries
2 parents 746fe56 + f12d239 commit 17c6b7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

code/weapon/weapons.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4941,7 +4941,8 @@ void weapon_process_post(object * obj, float frame_time)
49414941
t = f2fl(Missiontime - wp->creation_time) / wip->acceleration_time;
49424942
obj->phys_info.speed = wp->launch_speed + MAX(0.0f, wp->weapon_max_vel - wp->launch_speed) * t;
49434943
} else {
4944-
obj->phys_info.speed = wip->max_speed;;
4944+
obj->phys_info.speed = wip->max_speed;
4945+
obj->phys_info.flags |= PF_CONST_VEL; // Max speed reached, can use simpler physics calculations now
49454946
}
49464947

49474948
vm_vec_copy_scale( &obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.speed);
@@ -5371,7 +5372,7 @@ int weapon_create( vec3d * pos, matrix * porient, int weapon_type, int parent_ob
53715372

53725373
// check if laser or dumbfire missile
53735374
// set physics flag to allow optimization
5374-
if ((wip->subtype == WP_LASER) || ((wip->subtype == WP_MISSILE) && !(wip->wi_flags & WIF_HOMING))) {
5375+
if ((wip->subtype == WP_LASER) || ((wip->subtype == WP_MISSILE) && !(wip->wi_flags & WIF_HOMING) && wip->acceleration_time == 0.0f)) {
53755376
// set physics flag
53765377
objp->phys_info.flags |= PF_CONST_VEL;
53775378
}

0 commit comments

Comments
 (0)