renamed some variables and added files; more CAutomobile::ProcessControl

This commit is contained in:
aap
2019-07-17 13:19:20 +02:00
parent 3bda0da403
commit 0f1fbf5e9a
20 changed files with 217 additions and 49 deletions

View File

@@ -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--;
}
}