summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-08-16 00:25:47 +0200
committeraap <aap@papnet.eu>2021-08-16 00:25:47 +0200
commit97aeb85d84734ee768795756455e9e86903486bd (patch)
treedfa58907786ab523b985846fe05d833c594e6ede /src
parentbruh (diff)
downloadre3-97aeb85d84734ee768795756455e9e86903486bd.tar
re3-97aeb85d84734ee768795756455e9e86903486bd.tar.gz
re3-97aeb85d84734ee768795756455e9e86903486bd.tar.bz2
re3-97aeb85d84734ee768795756455e9e86903486bd.tar.lz
re3-97aeb85d84734ee768795756455e9e86903486bd.tar.xz
re3-97aeb85d84734ee768795756455e9e86903486bd.tar.zst
re3-97aeb85d84734ee768795756455e9e86903486bd.zip
Diffstat (limited to 'src')
-rw-r--r--src/vehicles/Automobile.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 0e1a3e42..7b3a8921 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -995,19 +995,19 @@ CAutomobile::ProcessControl(void)
}else{
if(GetModelIndex() == MI_MRWHOOP){
if(Pads[0].bHornHistory[Pads[0].iCurrHornHistory] &&
- !Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+4) % 5]){
+ !Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+CPad::HORNHISTORY_SIZE-1) % CPad::HORNHISTORY_SIZE]){
m_bSirenOrAlarm = !m_bSirenOrAlarm;
printf("m_bSirenOrAlarm toggled to %d\n", m_bSirenOrAlarm);
}
}else if(UsesSiren(GetModelIndex())){
if(Pads[0].bHornHistory[Pads[0].iCurrHornHistory]){
- if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+4) % 5] &&
- Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+3) % 5])
+ if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+CPad::HORNHISTORY_SIZE-1) % CPad::HORNHISTORY_SIZE] &&
+ Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+CPad::HORNHISTORY_SIZE-2) % CPad::HORNHISTORY_SIZE])
m_nCarHornTimer = 1;
else
m_nCarHornTimer = 0;
- }else if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+4) % 5] &&
- !Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+1) % 5]){
+ }else if(Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+CPad::HORNHISTORY_SIZE-1) % CPad::HORNHISTORY_SIZE] &&
+ !Pads[0].bHornHistory[(Pads[0].iCurrHornHistory+1) % CPad::HORNHISTORY_SIZE]){
m_nCarHornTimer = 0;
m_bSirenOrAlarm = !m_bSirenOrAlarm;
}else
@@ -3496,9 +3496,9 @@ CAutomobile::dmgDrawCarCollidingParticles(const CVector &pos, float amount)
nil,
CGeneral::GetRandomNumberInRange(0.02f, 0.08f),
CVehicleModelInfo::ms_vehicleColourTable[m_currentColour1],
- CGeneral::GetRandomNumberInRange(-40.0f, 40.0f),
+ CGeneral::GetRandomNumberInRange(-40, 40),
0,
- CGeneral::GetRandomNumberInRange(0.0f, 4.0f));
+ CGeneral::GetRandomNumberInRange(0, 4));
}
void
@@ -3955,7 +3955,9 @@ CAutomobile::SetUpWheelColModel(CColModel *colModel)
return true;
}
-// this probably isn't used in III yet
+float fBurstForceMult = 0.03f;
+
+// this isn't used in III yet
void
CAutomobile::BurstTyre(uint8 wheel)
{
@@ -3975,8 +3977,8 @@ CAutomobile::BurstTyre(uint8 wheel)
CCarCtrl::SwitchVehicleToRealPhysics(this);
}
- ApplyMoveForce(GetRight() * m_fMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f));
- ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-0.03f, 0.03f), GetForward());
+ ApplyMoveForce(GetRight() * m_fMass * CGeneral::GetRandomNumberInRange(-fBurstForceMult, fBurstForceMult));
+ ApplyTurnForce(GetRight() * m_fTurnMass * CGeneral::GetRandomNumberInRange(-fBurstForceMult, fBurstForceMult), GetForward());
}
}