From a5b84eb9fe32689f0aee10077854a3652c986c08 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 17 May 2020 21:43:11 +0300 Subject: full script basic support --- src/vehicles/Automobile.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/vehicles/Automobile.cpp') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index d1f2faaa..8486d9e1 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -72,6 +72,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy) bFixedColour = false; bBigWheels = false; bWaterTight = false; + bTankDetonateCars = true; SetModelIndex(id); @@ -332,7 +333,7 @@ CAutomobile::ProcessControl(void) bool playerRemote = false; switch(GetStatus()){ case STATUS_PLAYER_REMOTE: - if(CPad::GetPad(0)->WeaponJustDown()){ + if(CPad::GetPad(0)->WeaponJustDown() && !bDisableRemoteDetonation){ BlowUpCar(FindPlayerPed()); CRemote::TakeRemoteControlledCarFromPlayer(); } @@ -4139,7 +4140,7 @@ CAutomobile::BlowUpCarsInPath(void) { int i; - if(m_vecMoveSpeed.Magnitude() > 0.1f) + if(m_vecMoveSpeed.Magnitude() > 0.1f && bTankDetonateCars) for(i = 0; i < m_nCollisionRecords; i++) if(m_aCollisionRecords[i] && m_aCollisionRecords[i]->IsVehicle() && @@ -4601,6 +4602,18 @@ CAutomobile::SetAllTaxiLights(bool set) m_sAllTaxiLights = set; } +void +CAutomobile::TellHeliToGoToCoors(float x, float y, float z, uint8 speed) +{ + AutoPilot.m_nCarMission = MISSION_HELI_FLYTOCOORS; + AutoPilot.m_vecDestinationCoors.x = x; + AutoPilot.m_vecDestinationCoors.y = y; + AutoPilot.m_vecDestinationCoors.z = z; + AutoPilot.m_nCruiseSpeed = speed; + SetStatus(STATUS_PHYSICS); + assert(0); // TODO(MIAMI) +} + #ifdef COMPATIBLE_SAVES void CAutomobile::Save(uint8*& buf) -- cgit v1.2.3 From 5ab2c85e977ffa98a204fb64070ab8acbba214af Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 18 May 2020 00:34:24 +0300 Subject: some debug changes --- src/vehicles/Automobile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Automobile.cpp') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index aff09b8c..aad31bbf 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -4620,7 +4620,7 @@ CAutomobile::TellHeliToGoToCoors(float x, float y, float z, uint8 speed) AutoPilot.m_vecDestinationCoors.z = z; AutoPilot.m_nCruiseSpeed = speed; SetStatus(STATUS_PHYSICS); - assert(0); // TODO(MIAMI) + //TODO(MIAMI) } #ifdef COMPATIBLE_SAVES -- cgit v1.2.3 From abd230dcddd7e878f8a6b69193eb0cb74959c7b9 Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 18 May 2020 16:55:38 +0200 Subject: some less certainly fps fixes --- src/vehicles/Automobile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/vehicles/Automobile.cpp') diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index aad31bbf..e0ee0296 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -865,8 +865,14 @@ CAutomobile::ProcessControl(void) CVector wheelFwd = GetForward(); CVector wheelRight = GetRight(); +#ifdef FIX_BUGS + // Not sure if this is needed, but brake usually has timestep as a factor + if(bIsHandbrakeOn) + brake = 20000.0f * CTimer::GetTimeStepFix(); +#else if(bIsHandbrakeOn) brake = 20000.0f; +#endif if(m_aWheelTimer[CARWHEEL_REAR_LEFT] > 0.0f){ if(mod_HandlingManager.HasFrontWheelDrive(pHandling->nIdentifier)) -- cgit v1.2.3