Skip to content

Commit a246ef2

Browse files
authored
make sure to cap bank_vel (#4487)
1 parent e8d379a commit a246ef2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

code/math/vecmat.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,7 @@ void vm_angular_move_forward_vec(const vec3d* goal_f, const matrix* orient, cons
20702070

20712071
// handle bank separately, simpler, since its just a target velocity
20722072
{
2073+
CLAMP(bank_vel, -vel_limit->xyz.z, vel_limit->xyz.z);
20732074
float delta_bank_vel = bank_vel - w_in->xyz.z;
20742075
float delta_bank_accel = fl_abs(delta_bank_vel) / delta_t; // the accel required to reach the target vel this frame
20752076
float accel = (delta_bank_accel > acc_limit->xyz.z) ? acc_limit->xyz.z : delta_bank_accel;

0 commit comments

Comments
 (0)