summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-09-29 01:29:10 +0200
committereray orçunus <erayorcunus@gmail.com>2020-09-29 01:29:10 +0200
commita0588ef8b1e54765c042dd5cdeb9b4b31cad578f (patch)
tree6445a74783c808eb2b00d37fc4e1de8019b4c47b /src/vehicles/Automobile.cpp
parentCredits & fixes (diff)
downloadre3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar.gz
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar.bz2
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar.lz
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar.xz
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.tar.zst
re3-a0588ef8b1e54765c042dd5cdeb9b4b31cad578f.zip
Diffstat (limited to 'src/vehicles/Automobile.cpp')
-rw-r--r--src/vehicles/Automobile.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index eec44c35..5c5cf6b4 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -100,7 +100,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
}
pHandling = mod_HandlingManager.GetHandlingData((eHandlingId)mi->m_handlingId);
- pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)mi->m_handlingId);
+ pFlyingHandling = mod_HandlingManager.GetFlyingPointer((eHandlingId)mi->m_handlingId);
m_auto_unused1 = 20.0f;
m_auto_unused2 = 0;
@@ -1293,7 +1293,7 @@ CAutomobile::ProcessControl(void)
// Process front wheels off ground
- if(!IsRealHeli()){
+ if (!IsRealHeli()) {
if(m_aWheelTimer[CARWHEEL_FRONT_LEFT] <= 0.0f){
if(mod_HandlingManager.HasRearWheelDrive(pHandling->nIdentifier) || acceleration == 0.0f)
m_aWheelSpeed[CARWHEEL_FRONT_LEFT] *= 0.95f;
@@ -1397,24 +1397,31 @@ CAutomobile::ProcessControl(void)
}else if(GetModelIndex() == MI_RCBARON){
FlyingControl(FLIGHT_MODEL_RCPLANE);
}else if(IsRealHeli() || bAllCarCheat){
- // Speed up rotor
- if(m_aWheelSpeed[1] < 0.22f && !bIsInWater){
- if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
- m_aWheelSpeed[1] += 0.003f;
- else
- m_aWheelSpeed[1] += 0.001f;
- }
+#ifdef RESTORE_ALLCARSHELI_CHEAT
+ if (bAllCarCheat)
+ FlyingControl(FLIGHT_MODEL_HELI);
+ else
+#endif
+ {
+ // Speed up rotor
+ if (m_aWheelSpeed[1] < 0.22f && !bIsInWater) {
+ if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
+ m_aWheelSpeed[1] += 0.003f;
+ else
+ m_aWheelSpeed[1] += 0.001f;
+ }
- // Fly
- if(m_aWheelSpeed[1] > 0.15f){
- if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
- FlyingControl(FLIGHT_MODEL_RCHELI);
- else if(m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
- CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
- Abs(m_vecMoveSpeed.x) > 0.02f ||
- Abs(m_vecMoveSpeed.y) > 0.02f ||
- Abs(m_vecMoveSpeed.z) > 0.02f)
- FlyingControl(FLIGHT_MODEL_HELI);
+ // Fly
+ if (m_aWheelSpeed[1] > 0.15f) {
+ if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
+ FlyingControl(FLIGHT_MODEL_RCHELI);
+ else if (m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
+ CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
+ Abs(m_vecMoveSpeed.x) > 0.02f ||
+ Abs(m_vecMoveSpeed.y) > 0.02f ||
+ Abs(m_vecMoveSpeed.z) > 0.02f)
+ FlyingControl(FLIGHT_MODEL_HELI);
+ }
}
// Blade collision