summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorshfil <filip.gawin@zoho.com>2020-05-12 23:42:52 +0200
committerGitHub <noreply@github.com>2020-05-12 23:42:52 +0200
commitbd8a0e73056ae11f113c6859fecc3fbe3376dc0b (patch)
treecf51d6ab8430cd186e02f0e8105004f8e5476728 /src/vehicles
parentfix shotgun (diff)
parentFix linux warnings (diff)
downloadre3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar.gz
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar.bz2
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar.lz
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar.xz
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.tar.zst
re3-bd8a0e73056ae11f113c6859fecc3fbe3376dc0b.zip
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/Automobile.cpp9
-rw-r--r--src/vehicles/Boat.cpp1
-rw-r--r--src/vehicles/DamageManager.cpp1
-rw-r--r--src/vehicles/Heli.cpp4
-rw-r--r--src/vehicles/Train.cpp2
-rw-r--r--src/vehicles/Train.h2
6 files changed, 14 insertions, 5 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 60f17204..a880f26d 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -252,6 +252,7 @@ CAutomobile::ProcessControl(void)
strongGrip2 = true;
}
}
+ default: break;
}
}
@@ -423,6 +424,7 @@ CAutomobile::ProcessControl(void)
m_fGasPedal = 0.0f;
m_nCarHornTimer = 0;
break;
+ default: break;
}
// what's going on here?
@@ -1259,6 +1261,7 @@ CAutomobile::PreRender(void)
m_aWheelColPoints[i].point + CVector(0.0f, 0.0f, 0.05f),
CVector(0.0f, 0.0f, 0.0f), nil, 0.1f);
break;
+ default: break;
}
}
}else{
@@ -1383,6 +1386,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_LEFT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_LEFT]);
break;
+ default: break;
}
switch(m_aWheelState[CARWHEEL_REAR_RIGHT]){
@@ -1400,6 +1404,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_RIGHT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_RIGHT]);
break;
+ default: break;
}
}
@@ -1851,7 +1856,7 @@ CAutomobile::PreRender(void)
false);
CVector pos = GetPosition() - 4.0f*GetForward();
if(Damage.GetLightStatus(VEHLIGHT_REAR_LEFT) == LIGHT_STATUS_OK ||
- Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK)
+ Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK) {
if(m_fBrakePedal > 0.0f)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
10.0f, 1.0f, 0.0f, 0.0f,
@@ -1860,6 +1865,7 @@ CAutomobile::PreRender(void)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
7.0f, 0.6f, 0.0f, 0.0f,
CPointLights::FOG_NONE, false);
+ }
}
}else{
// Lights off
@@ -3781,6 +3787,7 @@ CAutomobile::IsDoorReady(eDoors door)
case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break;
case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break;
case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break;
+ default: break;
}
return (doorflag & m_nGettingInFlags) == 0;
}
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 348f2732..d992d190 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -180,6 +180,7 @@ CBoat::ProcessControl(void)
return;
}
break;
+ default: break;
}
float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse;
diff --git a/src/vehicles/DamageManager.cpp b/src/vehicles/DamageManager.cpp
index 03ccfe77..6b59ccda 100644
--- a/src/vehicles/DamageManager.cpp
+++ b/src/vehicles/DamageManager.cpp
@@ -85,6 +85,7 @@ CDamageManager::ApplyDamage(tComponent component, float damage, float unused)
ProgressEngineDamage();
ProgressPanelDamage(subComp);
break;
+ default: break;
}
return true;
}
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index e4cd5883..7b62b461 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -996,7 +996,7 @@ CHeli::TestRocketCollision(CVector *rocketPos)
for(i = 0; i < NUM_HELIS; i++){
if(pHelis[i] && !pHelis[i]->bExplosionProof && (*rocketPos - pHelis[i]->GetPosition()).MagnitudeSqr() < sq(8.0f)){
- pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f;
+ pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
hit = true;
@@ -1023,7 +1023,7 @@ CHeli::TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, i
if(pHelis[i]->m_heliType == HELI_CATALINA && pHelis[i]->m_nBulletDamage > 400 ||
pHelis[i]->m_heliType != HELI_CATALINA && pHelis[i]->m_nBulletDamage > 700){
- pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f;
+ pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 7831a0c8..1d47ca3a 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -492,7 +492,7 @@ CTrain::Shutdown(void)
}
void
-CTrain::ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
+CTrain::ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail)
{
bool readingFile = false;
diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h
index 6aa76fa8..c645ecaf 100644
--- a/src/vehicles/Train.h
+++ b/src/vehicles/Train.h
@@ -87,7 +87,7 @@ public:
static void InitTrains(void);
static void Shutdown(void);
- static void ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
+ static void ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail);
static void UpdateTrains(void);
};