From da39624f1c694dbeaefc6762fd6867715cdb77bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Thu, 8 Oct 2020 00:21:44 +0300 Subject: Pad, BulletInfo, ProjectileInfo, fixes --- src/vehicles/Boat.cpp | 11 +++++++++-- src/vehicles/Vehicle.cpp | 2 ++ src/vehicles/Vehicle.h | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 1664ffd0..8c9dd241 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -959,17 +959,24 @@ CBoat::PreRender(void) matrix.Translate(pos); matrix.UpdateRW(); } + // FIX: Planes can also be controlled with GetCarGunUpDown +#ifdef FIX_BUGS + static float steeringUpDown = 0.0f; + steeringUpDown += ((Abs(CPad::GetPad(0)->GetCarGunUpDown()) > 1.0f ? (-CPad::GetPad(0)->GetCarGunUpDown() / 128.0f) : (-CPad::GetPad(0)->GetSteeringUpDown() / 128.0f)) - steeringUpDown) * Min(1.f, CTimer::GetTimeStep() / 5.f); +#else + float steeringUpDown = -CPad::GetPad(0)->GetSteeringUpDown()/128.0f; +#endif if(m_aBoatNodes[BOAT_REARFLAP_LEFT]){ matrix.Attach(RwFrameGetMatrix(m_aBoatNodes[BOAT_REARFLAP_LEFT])); pos = matrix.GetPosition(); - matrix.SetRotateX(-CPad::GetPad(0)->GetSteeringUpDown()/128.0f); + matrix.SetRotateX(steeringUpDown); matrix.Translate(pos); matrix.UpdateRW(); } if(m_aBoatNodes[BOAT_REARFLAP_RIGHT]){ matrix.Attach(RwFrameGetMatrix(m_aBoatNodes[BOAT_REARFLAP_RIGHT])); pos = matrix.GetPosition(); - matrix.SetRotateX(-CPad::GetPad(0)->GetSteeringUpDown()/128.0f); + matrix.SetRotateX(steeringUpDown); matrix.Translate(pos); matrix.UpdateRW(); } diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 79e27c00..66676869 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -41,6 +41,8 @@ bool CVehicle::bCheat3; bool CVehicle::bCheat4; bool CVehicle::bCheat5; bool CVehicle::bCheat8; +bool CVehicle::bCheat9; +bool CVehicle::bCheat10; #ifdef ALT_DODO_CHEAT bool CVehicle::bAltDodoCheat; #endif diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 34106327..b40882d6 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -400,6 +400,8 @@ public: static bool bCheat4; static bool bCheat5; static bool bCheat8; + static bool bCheat9; + static bool bCheat10; #ifdef ALT_DODO_CHEAT static bool bAltDodoCheat; #endif -- cgit v1.2.3 From fec01aeff1daa891d754bd249f053652788d6f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Sun, 4 Oct 2020 22:39:54 +0300 Subject: Fix some sanitizer errors, improve POSIX streamer --- src/vehicles/CarGen.cpp | 9 +++++++-- src/vehicles/Vehicle.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/CarGen.cpp b/src/vehicles/CarGen.cpp index b0fa91a4..598b8342 100644 --- a/src/vehicles/CarGen.cpp +++ b/src/vehicles/CarGen.cpp @@ -28,8 +28,13 @@ uint32 CTheCarGenerators::CurrentActiveCount; void CCarGenerator::SwitchOff() { - m_nUsesRemaining = 0; - --CTheCarGenerators::CurrentActiveCount; +#ifdef FIX_BUGS + if (m_nUsesRemaining != 0) +#endif + { + m_nUsesRemaining = 0; + --CTheCarGenerators::CurrentActiveCount; + } } void CCarGenerator::SwitchOn() diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 6bd6f7c6..ae969921 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -187,7 +187,7 @@ public: CAutoPilot AutoPilot; uint8 m_currentColour1; uint8 m_currentColour2; - uint8 m_aExtras[2]; + int8 m_aExtras[2]; int16 m_nAlarmState; int16 m_nRouteSeed; CPed *pDriver; -- cgit v1.2.3 From e52c5ca1bb1288fbdfecef8857ebcf47eabbff1f Mon Sep 17 00:00:00 2001 From: Roman Masanin <36927roma@gmail.com> Date: Thu, 8 Oct 2020 20:34:59 +0300 Subject: fix for wheelie cras --- src/vehicles/Automobile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vehicles') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 01a4f094..1316985d 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -841,8 +841,8 @@ CAutomobile::ProcessControl(void) m_nBusDoorTimerEnd -= CTimer::GetTimeStepInMilliseconds(); } - if(m_aSuspensionSpringRatio[0] < 1.0f || m_aSuspensionSpringRatio[1] < 1.0f || - m_aSuspensionSpringRatio[2] < 1.0f || m_aSuspensionSpringRatio[3] < 1.0f) + if((m_aSuspensionSpringRatio[0] < 1.0f || m_aSuspensionSpringRatio[2] < 1.0f) && + (m_aSuspensionSpringRatio[1] < 1.0f || m_aSuspensionSpringRatio[3] < 1.0f)) ApplyTurnForce(-GRAVITY*Min(m_fTurnMass, 2500.0f)*GetUp(), -1.0f*GetForward()); } -- cgit v1.2.3