summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Vehicle.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-19 16:38:48 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-19 16:38:48 +0200
commitdf376a13ea8dac7ecff2aabe7d715774bcc7c294 (patch)
treedc4c0230c14bce31044813c8dc4048a837c0c278 /src/vehicles/Vehicle.cpp
parent1.1 patch stuff (diff)
parentMerge pull request #474 from Nick007J/master (diff)
downloadre3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar.gz
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar.bz2
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar.lz
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar.xz
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.tar.zst
re3-df376a13ea8dac7ecff2aabe7d715774bcc7c294.zip
Diffstat (limited to 'src/vehicles/Vehicle.cpp')
-rw-r--r--src/vehicles/Vehicle.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index bc47b486..0ed83f87 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -65,7 +65,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_nNumGettingIn = 0;
m_nGettingInFlags = 0;
m_nGettingOutFlags = 0;
- m_nNumMaxPassengers = 8;
+ m_nNumMaxPassengers = ARRAY_SIZE(pPassengers);
for(i = 0; i < m_nNumMaxPassengers; i++)
pPassengers[i] = nil;
m_nBombTimer = 0;
@@ -101,7 +101,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_nLastWeaponDamage = -1;
m_fMapObjectHeightAhead = m_fMapObjectHeightBehind = 0.0f;
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
- if(m_audioEntityId)
+ if(m_audioEntityId >= 0)
DMAudio.SetEntityStatus(m_audioEntityId, true);
m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK;
m_pCurGroundEntity = nil;
@@ -728,7 +728,7 @@ CVehicle::CanBeDeleted(void)
return false;
}
- for(i = 0; i < 8; i++){
+ for(i = 0; i < ARRAY_SIZE(pPassengers); i++){
// Same check as above
if(pPassengers[i]){
if(pPassengers[i]->CharCreatedBy == MISSION_CHAR)
@@ -941,7 +941,7 @@ void
CVehicle::RemovePassenger(CPed *p)
{
if (IsTrain()){
- for (int i = 0; i < 8; i++){
+ for (int i = 0; i < ARRAY_SIZE(pPassengers); i++){
if (pPassengers[i] == p) {
pPassengers[i] = nil;
m_nNumPassengers--;