summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Transmission.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-17 15:13:00 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-17 15:13:00 +0200
commit06ed308bb1a2383125cf04fd712b1753c4ba1d55 (patch)
tree713a8e10b3657d4c3a0d9c20c3704e0da8f9357e /src/vehicles/Transmission.cpp
parentMerge branch 'master' of git://github.com/GTAmodding/re3 into erorcun (diff)
parentrenamed some variables and added files; more CAutomobile::ProcessControl (diff)
downloadre3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.gz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.bz2
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.lz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.xz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.zst
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Transmission.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vehicles/Transmission.cpp b/src/vehicles/Transmission.cpp
index 2be25cbb..f8c345f1 100644
--- a/src/vehicles/Transmission.cpp
+++ b/src/vehicles/Transmission.cpp
@@ -35,3 +35,18 @@ cTransmission::InitGearRatios(void)
Gears[1].fShiftDownVelocity = -0.01f;
}
+
+void
+cTransmission::CalculateGearForSimpleCar(float speed, uint8 &gear)
+{
+ static tGear *pGearRatio = &Gears[gear];
+ fCurVelocity = speed;
+ if(speed > pGearRatio->fShiftUpVelocity)
+ gear++;
+ else if(speed < pGearRatio->fShiftDownVelocity){
+ if(gear - 1 < 0)
+ gear = 0;
+ else
+ gear--;
+ }
+}