From 5fd330b35e0a72ccceb1323e78bd227f571b7aee Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 7 Jun 2020 11:31:52 +0300 Subject: [PATCH] making it close to original --- src/vehicles/Bike.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 9c769fb0..a7edbfd6 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -2442,16 +2442,24 @@ CBike::BurstTyre(uint8 wheel, bool applyForces) ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.02f, 0.02f), GetForward()); } -#ifdef FIX_SIGNIFICANT_BUGS // This code checks piece types originally so it is never triggered // as we have converted them to wheel indices above already. if(pDriver){ +#ifdef FIX_SIGNIFICANT_BUGS if(wheel == BIKEWHEEL_FRONT && (m_aSuspensionSpringRatioPrev[BIKESUSP_F1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_F2] < 1.0f) || wheel == BIKEWHEEL_REAR && (m_aSuspensionSpringRatioPrev[BIKESUSP_R1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_R2] < 1.0f)){ +#else + if(wheel == CAR_PIECE_WHEEL_LF && (m_aSuspensionSpringRatioPrev[BIKESUSP_F1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_F2] < 1.0f) || + wheel == CAR_PIECE_WHEEL_LR && (m_aSuspensionSpringRatioPrev[BIKESUSP_R1] < 1.0f || m_aSuspensionSpringRatioPrev[BIKESUSP_R2] < 1.0f)){ +#endif float speedSq = m_vecMoveSpeed.MagnitudeSqr(); if(speedSq > fBikeBurstFallSpeed && (GetStatus() != STATUS_PLAYER || speedSq > fBikeBurstFallSpeedPlayer)){ +#ifdef FIX_SIGNIFICANT_BUGS if(wheel == BIKEWHEEL_FRONT){ +#else + if(wheel == CAR_PIECE_WHEEL_LF){ +#endif KnockOffRider(WEAPONTYPE_RAMMEDBYCAR, 0, pDriver, false); if(pPassengers[0]) KnockOffRider(WEAPONTYPE_RAMMEDBYCAR, 0, pPassengers[0], false); @@ -2460,7 +2468,6 @@ CBike::BurstTyre(uint8 wheel, bool applyForces) } } } -#endif } }