|
1 | 1 | /*****************************************************************************
|
2 | 2 | *
|
3 |
| - * PROJECT: Multi Theft Auto v1.0 |
| 3 | + * PROJECT: Multi Theft Auto |
4 | 4 | * LICENSE: See LICENSE in the top level directory
|
5 |
| - * FILE: game_sa/CHandlingEntrySA.h |
| 5 | + * FILE: Client/game_sa/CHandlingEntrySA.h |
6 | 6 | * PURPOSE: Header file for vehicle handling data entry class
|
7 | 7 | *
|
8 |
| - * Multi Theft Auto is available from http://www.multitheftauto.com/ |
| 8 | + * Multi Theft Auto is available from https://multitheftauto.com/ |
9 | 9 | *
|
10 | 10 | *****************************************************************************/
|
11 | 11 |
|
12 | 12 | #pragma once
|
13 | 13 |
|
14 | 14 | #include <game/CHandlingEntry.h>
|
| 15 | + |
15 | 16 | #define FUNC_HandlingDataMgr_ConvertDataToGameUnits 0x6F5080
|
16 | 17 |
|
17 | 18 | // http://www.gtamodding.com/index.php?title=Handling.cfg#GTA_San_Andreas
|
@@ -95,111 +96,107 @@ class CHandlingEntrySA : public CHandlingEntry
|
95 | 96 | virtual ~CHandlingEntrySA();
|
96 | 97 |
|
97 | 98 | // Use this to copy data from an another handling class to this
|
98 |
| - void Assign(const CHandlingEntry* pData); |
| 99 | + void Assign(const CHandlingEntry* pEntry); |
99 | 100 |
|
100 | 101 | // Get functions
|
101 |
| - float GetMass() const { return m_Handling.fMass; }; |
102 |
| - float GetTurnMass() const { return m_Handling.fTurnMass; }; |
103 |
| - float GetDragCoeff() const { return m_Handling.fDragCoeff; }; |
104 |
| - const CVector& GetCenterOfMass() const { return m_Handling.vecCenterOfMass; }; |
| 102 | + float GetMass() const { return m_Handling.fMass; } |
| 103 | + float GetTurnMass() const { return m_Handling.fTurnMass; } |
| 104 | + float GetDragCoeff() const { return m_Handling.fDragCoeff; } |
| 105 | + const CVector& GetCenterOfMass() const { return m_Handling.vecCenterOfMass; } |
105 | 106 |
|
106 |
| - unsigned int GetPercentSubmerged() const { return m_Handling.uiPercentSubmerged; }; |
107 |
| - float GetTractionMultiplier() const { return m_Handling.fTractionMultiplier; }; |
| 107 | + unsigned int GetPercentSubmerged() const { return m_Handling.uiPercentSubmerged; } |
| 108 | + float GetTractionMultiplier() const { return m_Handling.fTractionMultiplier; } |
108 | 109 |
|
109 |
| - eDriveType GetCarDriveType() const { return static_cast<eDriveType>(m_Handling.Transmission.ucDriveType); }; |
110 |
| - eEngineType GetCarEngineType() const { return static_cast<eEngineType>(m_Handling.Transmission.ucEngineType); }; |
111 |
| - unsigned char GetNumberOfGears() const { return m_Handling.Transmission.ucNumberOfGears; }; |
| 110 | + eDriveType GetCarDriveType() const { return static_cast<eDriveType>(m_Handling.Transmission.ucDriveType); } |
| 111 | + eEngineType GetCarEngineType() const { return static_cast<eEngineType>(m_Handling.Transmission.ucEngineType); } |
| 112 | + unsigned char GetNumberOfGears() const { return m_Handling.Transmission.ucNumberOfGears; } |
112 | 113 |
|
113 |
| - float GetEngineAcceleration() const { return m_Handling.Transmission.fEngineAcceleration; }; |
114 |
| - float GetEngineInertia() const { return m_Handling.Transmission.fEngineInertia; }; |
115 |
| - float GetMaxVelocity() const { return m_Handling.Transmission.fMaxVelocity; }; |
| 114 | + float GetEngineAcceleration() const { return m_Handling.Transmission.fEngineAcceleration; } |
| 115 | + float GetEngineInertia() const { return m_Handling.Transmission.fEngineInertia; } |
| 116 | + float GetMaxVelocity() const { return m_Handling.Transmission.fMaxVelocity; } |
116 | 117 |
|
117 |
| - float GetBrakeDeceleration() const { return m_Handling.fBrakeDeceleration; }; |
118 |
| - float GetBrakeBias() const { return m_Handling.fBrakeBias; }; |
119 |
| - bool GetABS() const { return m_Handling.bABS; }; |
| 118 | + float GetBrakeDeceleration() const { return m_Handling.fBrakeDeceleration; } |
| 119 | + float GetBrakeBias() const { return m_Handling.fBrakeBias; } |
| 120 | + bool GetABS() const { return m_Handling.bABS; } |
120 | 121 |
|
121 |
| - float GetSteeringLock() const { return m_Handling.fSteeringLock; }; |
122 |
| - float GetTractionLoss() const { return m_Handling.fTractionLoss; }; |
123 |
| - float GetTractionBias() const { return m_Handling.fTractionBias; }; |
| 122 | + float GetSteeringLock() const { return m_Handling.fSteeringLock; } |
| 123 | + float GetTractionLoss() const { return m_Handling.fTractionLoss; } |
| 124 | + float GetTractionBias() const { return m_Handling.fTractionBias; } |
124 | 125 |
|
125 |
| - float GetSuspensionForceLevel() const { return m_Handling.fSuspensionForceLevel; }; |
126 |
| - float GetSuspensionDamping() const { return m_Handling.fSuspensionDamping; }; |
127 |
| - float GetSuspensionHighSpeedDamping() const { return m_Handling.fSuspensionHighSpdDamping; }; |
128 |
| - float GetSuspensionUpperLimit() const { return m_Handling.fSuspensionUpperLimit; }; |
129 |
| - float GetSuspensionLowerLimit() const { return m_Handling.fSuspensionLowerLimit; }; |
130 |
| - float GetSuspensionFrontRearBias() const { return m_Handling.fSuspensionFrontRearBias; }; |
131 |
| - float GetSuspensionAntiDiveMultiplier() const { return m_Handling.fSuspensionAntiDiveMultiplier; }; |
| 126 | + float GetSuspensionForceLevel() const { return m_Handling.fSuspensionForceLevel; } |
| 127 | + float GetSuspensionDamping() const { return m_Handling.fSuspensionDamping; } |
| 128 | + float GetSuspensionHighSpeedDamping() const { return m_Handling.fSuspensionHighSpdDamping; } |
| 129 | + float GetSuspensionUpperLimit() const { return m_Handling.fSuspensionUpperLimit; } |
| 130 | + float GetSuspensionLowerLimit() const { return m_Handling.fSuspensionLowerLimit; } |
| 131 | + float GetSuspensionFrontRearBias() const { return m_Handling.fSuspensionFrontRearBias; } |
| 132 | + float GetSuspensionAntiDiveMultiplier() const { return m_Handling.fSuspensionAntiDiveMultiplier; } |
132 | 133 |
|
133 |
| - float GetCollisionDamageMultiplier() const { return m_Handling.fCollisionDamageMultiplier; }; |
| 134 | + float GetCollisionDamageMultiplier() const { return m_Handling.fCollisionDamageMultiplier; } |
134 | 135 |
|
135 |
| - unsigned int GetHandlingFlags() const { return m_Handling.uiHandlingFlags; }; |
136 |
| - unsigned int GetModelFlags() const { return m_Handling.uiModelFlags; }; |
137 |
| - float GetSeatOffsetDistance() const { return m_Handling.fSeatOffsetDistance; }; |
138 |
| - unsigned int GetMonetary() const { return m_Handling.uiMonetary; }; |
| 136 | + unsigned int GetHandlingFlags() const { return m_Handling.uiHandlingFlags; } |
| 137 | + unsigned int GetModelFlags() const { return m_Handling.uiModelFlags; } |
| 138 | + float GetSeatOffsetDistance() const { return m_Handling.fSeatOffsetDistance; } |
| 139 | + unsigned int GetMonetary() const { return m_Handling.uiMonetary; } |
139 | 140 |
|
140 |
| - eLightType GetHeadLight() const { return static_cast<eLightType>(m_Handling.ucHeadLight); }; |
141 |
| - eLightType GetTailLight() const { return static_cast<eLightType>(m_Handling.ucTailLight); }; |
142 |
| - unsigned char GetAnimGroup() const { return m_Handling.ucAnimGroup; }; |
| 141 | + eLightType GetHeadLight() const { return static_cast<eLightType>(m_Handling.ucHeadLight); } |
| 142 | + eLightType GetTailLight() const { return static_cast<eLightType>(m_Handling.ucTailLight); } |
| 143 | + unsigned char GetAnimGroup() const { return m_Handling.ucAnimGroup; } |
143 | 144 |
|
144 |
| - eVehicleTypes GetModel() const { return static_cast<eVehicleTypes>(m_Handling.iVehicleID); }; |
145 |
| - bool HasSuspensionChanged() const { return true; }; |
| 145 | + std::uint16_t GetVehicleID() const { return static_cast<std::uint16_t>(m_Handling.iVehicleID); } |
146 | 146 |
|
147 | 147 | // Set functions
|
148 |
| - void SetMass(float fMass) { m_Handling.fMass = fMass; }; |
149 |
| - void SetTurnMass(float fTurnMass) { m_Handling.fTurnMass = fTurnMass; }; |
150 |
| - void SetDragCoeff(float fDrag) { m_Handling.fDragCoeff = fDrag; }; |
151 |
| - void SetCenterOfMass(const CVector& vecCenter) { m_Handling.vecCenterOfMass = vecCenter; }; |
| 148 | + void SetMass(float fMass) { m_Handling.fMass = fMass; } |
| 149 | + void SetTurnMass(float fTurnMass) { m_Handling.fTurnMass = fTurnMass; } |
| 150 | + void SetDragCoeff(float fDrag) { m_Handling.fDragCoeff = fDrag; } |
| 151 | + void SetCenterOfMass(const CVector& vecCenter) { m_Handling.vecCenterOfMass = vecCenter; } |
152 | 152 |
|
153 |
| - void SetPercentSubmerged(unsigned int uiPercent) { m_Handling.uiPercentSubmerged = uiPercent; }; |
154 |
| - void SetTractionMultiplier(float fTractionMultiplier) { m_Handling.fTractionMultiplier = fTractionMultiplier; }; |
| 153 | + void SetPercentSubmerged(unsigned int uiPercent) { m_Handling.uiPercentSubmerged = uiPercent; } |
| 154 | + void SetTractionMultiplier(float fTractionMultiplier) { m_Handling.fTractionMultiplier = fTractionMultiplier; } |
155 | 155 |
|
156 |
| - void SetCarDriveType(eDriveType Type) { m_Handling.Transmission.ucDriveType = Type; }; |
157 |
| - void SetCarEngineType(eEngineType Type) { m_Handling.Transmission.ucEngineType = Type; }; |
158 |
| - void SetNumberOfGears(unsigned char ucNumber) { m_Handling.Transmission.ucNumberOfGears = ucNumber; }; |
| 156 | + void SetCarDriveType(eDriveType Type) { m_Handling.Transmission.ucDriveType = Type; } |
| 157 | + void SetCarEngineType(eEngineType Type) { m_Handling.Transmission.ucEngineType = Type; } |
| 158 | + void SetNumberOfGears(unsigned char ucNumber) { m_Handling.Transmission.ucNumberOfGears = ucNumber; } |
159 | 159 |
|
160 |
| - void SetEngineAcceleration(float fAcceleration) { m_Handling.Transmission.fEngineAcceleration = fAcceleration; }; |
161 |
| - void SetEngineInertia(float fInertia) { m_Handling.Transmission.fEngineInertia = fInertia; }; |
162 |
| - void SetMaxVelocity(float fVelocity) { m_Handling.Transmission.fMaxVelocity = fVelocity; }; |
| 160 | + void SetEngineAcceleration(float fAcceleration) { m_Handling.Transmission.fEngineAcceleration = fAcceleration; } |
| 161 | + void SetEngineInertia(float fInertia) { m_Handling.Transmission.fEngineInertia = fInertia; } |
| 162 | + void SetMaxVelocity(float fVelocity) { m_Handling.Transmission.fMaxVelocity = fVelocity; } |
163 | 163 |
|
164 |
| - void SetBrakeDeceleration(float fDeceleration) { m_Handling.fBrakeDeceleration = fDeceleration; }; |
165 |
| - void SetBrakeBias(float fBias) { m_Handling.fBrakeBias = fBias; }; |
166 |
| - void SetABS(bool bABS) { m_Handling.bABS = bABS; }; |
| 164 | + void SetBrakeDeceleration(float fDeceleration) { m_Handling.fBrakeDeceleration = fDeceleration; } |
| 165 | + void SetBrakeBias(float fBias) { m_Handling.fBrakeBias = fBias; } |
| 166 | + void SetABS(bool bABS) { m_Handling.bABS = bABS; } |
167 | 167 |
|
168 |
| - void SetSteeringLock(float fSteeringLock) { m_Handling.fSteeringLock = fSteeringLock; }; |
169 |
| - void SetTractionLoss(float fTractionLoss) { m_Handling.fTractionLoss = fTractionLoss; }; |
170 |
| - void SetTractionBias(float fTractionBias) { m_Handling.fTractionBias = fTractionBias; }; |
| 168 | + void SetSteeringLock(float fSteeringLock) { m_Handling.fSteeringLock = fSteeringLock; } |
| 169 | + void SetTractionLoss(float fTractionLoss) { m_Handling.fTractionLoss = fTractionLoss; } |
| 170 | + void SetTractionBias(float fTractionBias) { m_Handling.fTractionBias = fTractionBias; } |
171 | 171 |
|
172 |
| - void SetSuspensionForceLevel(float fForce); |
173 |
| - void SetSuspensionDamping(float fDamping); |
174 |
| - void SetSuspensionHighSpeedDamping(float fDamping); |
175 |
| - void SetSuspensionUpperLimit(float fUpperLimit); |
176 |
| - void SetSuspensionLowerLimit(float fLowerLimit); |
177 |
| - void SetSuspensionFrontRearBias(float fBias); |
178 |
| - void SetSuspensionAntiDiveMultiplier(float fAntidive); |
| 172 | + void SetSuspensionForceLevel(float fForce) noexcept; |
| 173 | + void SetSuspensionDamping(float fDamping) noexcept; |
| 174 | + void SetSuspensionHighSpeedDamping(float fDamping) noexcept; |
| 175 | + void SetSuspensionUpperLimit(float fUpperLimit) noexcept; |
| 176 | + void SetSuspensionLowerLimit(float fLowerLimit) noexcept; |
| 177 | + void SetSuspensionFrontRearBias(float fBias) noexcept; |
| 178 | + void SetSuspensionAntiDiveMultiplier(float fAntidive) noexcept; |
179 | 179 |
|
180 |
| - void SetCollisionDamageMultiplier(float fMultiplier) { m_Handling.fCollisionDamageMultiplier = fMultiplier; }; |
| 180 | + void SetCollisionDamageMultiplier(float fMultiplier) { m_Handling.fCollisionDamageMultiplier = fMultiplier; } |
181 | 181 |
|
182 |
| - void SetHandlingFlags(unsigned int uiFlags) { m_Handling.uiHandlingFlags = uiFlags; }; |
183 |
| - void SetModelFlags(unsigned int uiFlags) { m_Handling.uiModelFlags = uiFlags; }; |
184 |
| - void SetSeatOffsetDistance(float fDistance) { m_Handling.fSeatOffsetDistance = fDistance; }; |
185 |
| - void SetMonetary(unsigned int uiMonetary) { m_Handling.uiMonetary = uiMonetary; }; |
| 182 | + void SetHandlingFlags(unsigned int uiFlags) { m_Handling.uiHandlingFlags = uiFlags; } |
| 183 | + void SetModelFlags(unsigned int uiFlags) { m_Handling.uiModelFlags = uiFlags; } |
| 184 | + void SetSeatOffsetDistance(float fDistance) { m_Handling.fSeatOffsetDistance = fDistance; } |
| 185 | + void SetMonetary(unsigned int uiMonetary) { m_Handling.uiMonetary = uiMonetary; } |
186 | 186 |
|
187 |
| - void SetHeadLight(eLightType Style) { m_Handling.ucHeadLight = Style; }; |
188 |
| - void SetTailLight(eLightType Style) { m_Handling.ucTailLight = Style; }; |
189 |
| - void SetAnimGroup(unsigned char ucGroup) { m_Handling.ucAnimGroup = ucGroup; }; |
| 187 | + void SetHeadLight(eLightType Style) { m_Handling.ucHeadLight = Style; } |
| 188 | + void SetTailLight(eLightType Style) { m_Handling.ucTailLight = Style; } |
| 189 | + void SetAnimGroup(unsigned char ucGroup) { m_Handling.ucAnimGroup = ucGroup; } |
190 | 190 |
|
191 |
| - void Recalculate(unsigned short usModel); |
| 191 | + void CheckSuspensionChanges() noexcept; |
192 | 192 |
|
193 |
| - tHandlingDataSA* GetInterface() { return m_pHandlingSA; }; |
| 193 | + void Recalculate(); |
194 | 194 |
|
195 |
| - void SetSuspensionChanged(bool bChanged) { m_bChanged = bChanged; }; |
| 195 | + tHandlingDataSA* GetInterface() const { return m_pHandlingSA; } |
196 | 196 |
|
197 | 197 | private:
|
198 | 198 | tHandlingDataSA* m_pHandlingSA;
|
199 | 199 | bool m_bDeleteInterface;
|
200 | 200 |
|
201 | 201 | tHandlingDataSA m_Handling;
|
202 |
| - |
203 |
| - tHandlingDataSA* m_pOriginalData; |
204 |
| - bool m_bChanged; |
205 | 202 | };
|
0 commit comments