void fix_movement(float original_yaw) {
float old_yaw = original_yaw + (original_yaw < 0.0f ? 360.0f : 0.0f);
float new_yaw = angle->yaw + (angle->yaw < 0.0f ? 360.0f : 0.0f);
float yaw_delta = new_yaw < old_yaw ? fabsf(new_yaw - old_yaw) : 360.0f - fabsf(new_yaw - old_yaw);
yaw_delta = 360.0f - yaw_delta;
const float _forwardmove = forwardmove;
const float _sidemove = leftmove;
forwardmove = std::cos(DEG2RAD(yaw_delta)) * _forwardmove + std::cos(DEG2RAD(yaw_delta + 90.0f)) * _sidemove;
leftmove = std::sin(DEG2RAD(yaw_delta)) * _forwardmove + std::sin(DEG2RAD(yaw_delta + 90.0f)) * _sidemove;
}