From 0548476ba6b9e2273ceec94ca9f62e76c69d7ef4 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 11 Jul 2019 12:48:49 +0200 Subject: CAutomobile::ProcessControlInputs --- src/vehicles/Vehicle.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index c293b8a6..55805e9d 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -144,7 +144,7 @@ public: CFire *m_pCarFire; float m_fSteerAngle; float m_fGasPedal; - float m_fBreakPedal; + float m_fBrakePedal; uint8 VehicleCreatedBy; // cf. https://github.com/DK22Pac/plugin-sdk/blob/master/plugin_sa/game_sa/CVehicle.h from R* @@ -161,7 +161,7 @@ public: uint8 bIsBus: 1; // Is this vehicle a bus uint8 bIsBig: 1; // Is this vehicle a bus uint8 bLowVehicle: 1; // Need this for sporty type cars to use low getting-in/out anims - uint8 m_veh_flagB10 : 1; + uint8 bComedyControls : 1; // Will make the car hard to control (hopefully in a funny way) uint8 m_veh_flagB20 : 1; uint8 m_veh_flagB40 : 1; uint8 m_veh_flagB80 : 1; @@ -207,7 +207,7 @@ public: uint8 m_nCarHornTimer; int8 field_22D; bool m_bSirenOrAlarm; - int8 field_22F; + int8 m_comedyControlState; CStoredCollPoly m_aCollPolys[2]; // poly which is under front/rear part of car float m_fSteerRatio; eVehicleType m_vehType; -- cgit v1.2.3 From 41dbd754dee344c79207e0821df6bcc262f90726 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 14 Jul 2019 12:49:03 +0300 Subject: Partial RunningScript part2 --- src/vehicles/Vehicle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 55805e9d..3d751bfe 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -20,7 +20,7 @@ enum eCarLock { CARLOCK_LOCKED, CARLOCK_LOCKOUT_PLAYER_ONLY, CARLOCK_LOCKED_PLAYER_INSIDE, - CARLOCK_COP_CAR, + CARLOCK_LOCKED_INITIALLY, CARLOCK_FORCE_SHUT_DOORS, CARLOCK_SKIP_SHUT_DOORS }; -- cgit v1.2.3 From b77a9ce9550d0326c8bd69fdc1474af4f3a1d268 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sun, 14 Jul 2019 14:49:27 +0300 Subject: RunningScript 2. So far with bugs (cops not caring, errors in arithmetical opcodes) --- src/vehicles/Vehicle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 3d751bfe..03bdad69 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -168,7 +168,7 @@ public: uint8 m_veh_flagC1 : 1; uint8 bIsDamaged : 1; // This vehicle has been damaged and is displaying all its components - uint8 m_veh_flagC4 : 1; + uint8 bHasBeenOwnedByPlayer : 1; uint8 m_veh_flagC8 : 1; uint8 m_veh_flagC10 : 1; uint8 m_veh_flagC20 : 1; -- cgit v1.2.3 From 36f3a517f9664415b07a4aa537db22159b67a8f2 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 16 Jul 2019 19:48:50 +0200 Subject: more fixes; started CAutomobile::ProcessControl --- src/vehicles/Vehicle.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 03bdad69..1f848dc8 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -126,7 +126,7 @@ class CVehicle : public CPhysical public: // 0x128 tHandlingData *m_handling; - CAutoPilot m_autoPilot; + CAutoPilot AutoPilot; uint8 m_currentColour1; uint8 m_currentColour2; uint8 m_aExtras[2]; @@ -162,14 +162,14 @@ public: uint8 bIsBig: 1; // Is this vehicle a bus uint8 bLowVehicle: 1; // Need this for sporty type cars to use low getting-in/out anims uint8 bComedyControls : 1; // Will make the car hard to control (hopefully in a funny way) - uint8 m_veh_flagB20 : 1; + uint8 bWarnedPeds : 1; // Has scan and warn peds of danger been processed? uint8 m_veh_flagB40 : 1; uint8 m_veh_flagB80 : 1; uint8 m_veh_flagC1 : 1; uint8 bIsDamaged : 1; // This vehicle has been damaged and is displaying all its components - uint8 bHasBeenOwnedByPlayer : 1; - uint8 m_veh_flagC8 : 1; + uint8 bHasBeenOwnedByPlayer : 1;// To work out whether stealing it is a crime + uint8 bFadeOut : 1; // Fade vehicle out uint8 m_veh_flagC10 : 1; uint8 m_veh_flagC20 : 1; uint8 bCanBeDamaged : 1; // Set to FALSE during cut scenes to avoid explosions @@ -196,7 +196,7 @@ public: uint32 m_nTimeOfDeath; int16 field_214; int16 m_nBombTimer; // goes down with each frame - CPed *m_pWhoSetMeOnFire; + CEntity *m_pBlowUpEntity; float field_21C; float field_220; eCarLock m_nDoorLock; -- cgit v1.2.3 From 0f1fbf5e9a7477c6fbb7645491598e87ed2e183e Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 17 Jul 2019 13:19:20 +0200 Subject: renamed some variables and added files; more CAutomobile::ProcessControl --- src/vehicles/Vehicle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 1f848dc8..b37ea84d 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -125,7 +125,7 @@ class CVehicle : public CPhysical { public: // 0x128 - tHandlingData *m_handling; + tHandlingData *pHandling; CAutoPilot AutoPilot; uint8 m_currentColour1; uint8 m_currentColour2; -- cgit v1.2.3 From ba242bcf584d885167a9499e53f5bcaf6c9cc866 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 17 Jul 2019 23:58:06 +0200 Subject: more CAutomobile::ProcessControl --- src/vehicles/Vehicle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index b37ea84d..de74264b 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -191,7 +191,7 @@ public: float m_fHealth; // 1000.0f = full health. 0 -> explode uint8 m_nCurrentGear; int8 field_205[3]; - int field_208; + float m_fChangeGearTime; uint32 m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats) uint32 m_nTimeOfDeath; int16 field_214; -- cgit v1.2.3 From fd01f9b25cdc3b527a886ee6b9237b01a5475295 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 18 Jul 2019 15:41:09 +0200 Subject: CAutomobile::ProcessControl done --- src/vehicles/Vehicle.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index de74264b..7513c0da 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -130,7 +130,7 @@ public: uint8 m_currentColour1; uint8 m_currentColour2; uint8 m_aExtras[2]; - int16 m_nAlarmState; // m_nWantedStarsOnEnter on DK22 + int16 m_nAlarmState; int16 m_nMissionValue; CPed *pDriver; CPed *pPassengers[8]; @@ -188,7 +188,7 @@ public: uint8 m_nAmmoInClip; // Used to make the guns on boat do a reload (20 by default) int8 field_1FB; int8 field_1FC[4]; - float m_fHealth; // 1000.0f = full health. 0 -> explode + float m_fHealth; // 1000.0f = full health. 250.0f = fire. 0 -> explode uint8 m_nCurrentGear; int8 field_205[3]; float m_fChangeGearTime; @@ -277,6 +277,8 @@ public: void RemoveDriver(void); void ProcessCarAlarm(void); bool IsSphereTouchingVehicle(float sx, float sy, float sz, float radius); + + bool IsAlarmOn(void) { return m_nAlarmState != 0 && m_nAlarmState != -1; } static bool &bWheelsOnlyCheat; static bool &bAllDodosCheat; -- cgit v1.2.3 From 9a7ce75c0371b4c35523a6c8872bba782a1eeb0b Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 18 Jul 2019 21:41:20 +0200 Subject: CAutomobile damage --- src/vehicles/Vehicle.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 7513c0da..3074bfb6 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -98,10 +98,23 @@ enum eWheels enum { - CAR_PIECE_WHEEL_LF = 13, + CAR_PIECE_BONNET = 1, + CAR_PIECE_BOOT, + CAR_PIECE_BUMP_FRONT, + CAR_PIECE_BUMP_REAR, + CAR_PIECE_DOOR_LF, + CAR_PIECE_DOOR_RF, + CAR_PIECE_DOOR_LR, + CAR_PIECE_DOOR_RR, + CAR_PIECE_WING_LF, + CAR_PIECE_WING_RF, + CAR_PIECE_WING_LR, + CAR_PIECE_WING_RR, + CAR_PIECE_WHEEL_LF, CAR_PIECE_WHEEL_LR, CAR_PIECE_WHEEL_RF, CAR_PIECE_WHEEL_RR, + CAR_PIECE_WINDSCREEN, }; enum tWheelState @@ -166,7 +179,7 @@ public: uint8 m_veh_flagB40 : 1; uint8 m_veh_flagB80 : 1; - uint8 m_veh_flagC1 : 1; + uint8 bTakeLessDamage : 1; // This vehicle is stronger (takes about 1/4 of damage) uint8 bIsDamaged : 1; // This vehicle has been damaged and is displaying all its components uint8 bHasBeenOwnedByPlayer : 1;// To work out whether stealing it is a crime uint8 bFadeOut : 1; // Fade vehicle out -- cgit v1.2.3 From a04d8f24be355b69bbba88b50055f2b1420fc29f Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Mon, 8 Jul 2019 21:44:32 +0200 Subject: ComputeDopplerEffectedFrequency --- src/vehicles/Vehicle.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 3074bfb6..4668ba7a 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -320,3 +320,19 @@ inline uint8 GetVehDoorFlag(int32 carnode) { return 0; } } + +class cTransmission; + +class cVehicleParams +{ +public: + char m_bDistanceCalculated; + char gap_1[3]; + float m_fDistance; + CVehicle *m_pVehicle; + cTransmission *m_pTransmission; + int m_nIndex; + float m_fVelocityChange; +}; + +static_assert(sizeof(cVehicleParams) == 0x18, "CVehicle: error"); -- cgit v1.2.3 From e9cafe340a16c489c5f6874066b9836d70bd0091 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 23 Jul 2019 16:39:30 +0200 Subject: bit more CAutomobile --- src/vehicles/Vehicle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vehicles/Vehicle.h') diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index 4668ba7a..38d411cd 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -210,8 +210,8 @@ public: int16 field_214; int16 m_nBombTimer; // goes down with each frame CEntity *m_pBlowUpEntity; - float field_21C; - float field_220; + float field_21C; // front Z? + float field_220; // rear Z? eCarLock m_nDoorLock; int8 m_nLastWeaponDamage; // see eWeaponType, -1 if no damage int8 m_nRadioStation; -- cgit v1.2.3