From db0758690e78f8df8304adab345958ce5cf496ed Mon Sep 17 00:00:00 2001 From: Roman Masanin <36927roma@gmail.com> Date: Wed, 30 Sep 2020 13:37:43 +0300 Subject: [PATCH] new implementation for car fly enhancment --- src/vehicles/Automobile.cpp | 2 +- src/vehicles/Vehicle.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 05596e75..24c84703 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -1390,7 +1390,7 @@ CAutomobile::ProcessControl(void) m_vecMoveSpeed.Magnitude() > 0.0f && CTimer::GetTimeStep() > 0.0f){ #ifdef ALT_DODO_CHEAT if (bAltDodoCheat) - FlyingControl(FLIGHT_MODEL_PLANE); + FlyingControl(FLIGHT_MODEL_PLANE_UNUSED); else #endif if(GetModelIndex() == MI_DODO) diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 2e790e81..d53f3c9f 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -351,14 +351,25 @@ CVehicle::FlyingControl(eFlightModel flightModel) fSteerUD *= -fSteerMult; // thrust + float fHandlingThrust = pFlyingHandling->fThrust; + float fThrustFallOff = pFlyingHandling->fThrustFallOff; + float fThrustFallOffBack = pFlyingHandling->fThrustFallOff * 8.0f; +#ifdef ALT_DODO_CHEAT + if (bAltDodoCheat && !IsRealPlane()) { + fHandlingThrust = pHandling->Transmission.fEngineAcceleration; + fHandlingThrust *= pHandling->Transmission.nDriveType == '4' ? 4 : 2; + fThrustFallOff = 0.7f / pHandling->Transmission.fMaxVelocity; + fThrustFallOffBack = 0.7f / pHandling->Transmission.fMaxReverseVelocity; + } +#endif // ALT_DOOD_CHEAT float fForwSpeed = DotProduct(GetMoveSpeed(), GetForward()); CVector vecTail = GetColModel()->boundingBox.min.y * GetForward(); float fThrust = (CPad::GetPad(0)->GetAccelerate() - CPad::GetPad(0)->GetBrake()) / 255.0f; float fThrustAccel; if(fForwSpeed > 0.0f || fThrust > 0.0f) - fThrustAccel = (fThrust - pFlyingHandling->fThrustFallOff * fForwSpeed) * pFlyingHandling->fThrust; + fThrustAccel = (fThrust - fThrustFallOff * fForwSpeed) * fHandlingThrust; else - fThrustAccel = Min(fThrust - 8.0f * pFlyingHandling->fThrustFallOff * fForwSpeed, 0.0f) * pFlyingHandling->fThrust; + fThrustAccel = Min(fThrust - fThrustFallOffBack * fForwSpeed, 0.0f) * fHandlingThrust; if(flightModel == FLIGHT_MODEL_PLANE_UNUSED) fThrustAccel *= 0.3f; else if(flightModel == FLIGHT_MODEL_PLANE)