Merge pull request #475 from erorcun/erorcun

Struct cleanup, various fixes, enable PS2 rand
This commit is contained in:
erorcun 2020-04-19 16:54:05 +03:00 committed by GitHub
commit f9ed50e178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 93 additions and 80 deletions

View File

@ -45,7 +45,7 @@ class cSampleManager
uint8 m_nEffectsFadeVolume;
uint8 m_nMusicFadeVolume;
uint8 m_nMonoMode;
char _pad0[1];
char unk;
char m_szCDRomRootPath[80];
bool m_bInitialised;
uint8 m_nNumberOfProviders;

View File

@ -99,7 +99,7 @@ CPickup::GiveUsAPickUpObject(int32 handle)
switch (m_eType)
{
case PICKUP_IN_SHOP:
object->m_obj_flag2 = true;
object->bPickupObjWithMessage = true;
object->bOutOfStock = false;
break;
case PICKUP_ON_STREET:
@ -113,11 +113,11 @@ CPickup::GiveUsAPickUpObject(int32 handle)
case PICKUP_NAUTICAL_MINE_ARMED:
case PICKUP_FLOATINGPACKAGE:
case PICKUP_ON_STREET_SLOW:
object->m_obj_flag2 = false;
object->bPickupObjWithMessage = false;
object->bOutOfStock = false;
break;
case PICKUP_IN_SHOP_OUT_OF_STOCK:
object->m_obj_flag2 = false;
object->bPickupObjWithMessage = false;
object->bOutOfStock = true;
object->bRenderScorched = true;
break;
@ -690,7 +690,7 @@ CPickups::DoPickUpEffects(CEntity *entity)
size, 65.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
CObject *object = (CObject*)entity;
if (object->m_obj_flag2 || object->bOutOfStock || object->m_nBonusValue) {
if (object->bPickupObjWithMessage || object->bOutOfStock || object->m_nBonusValue) {
float dist = (TheCamera.GetPosition() - pos).Magnitude();
const float MAXDIST = 12.0f;

View File

@ -8931,7 +8931,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed);
if (ScriptParams[1])
pPed->m_nZoneLevel = -1;
pPed->m_nZoneLevel = LEVEL_IGNORE;
else
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(pPed->GetPosition());
return 0;
@ -9130,7 +9130,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
if (ScriptParams[1])
pVehicle->m_nZoneLevel = -1;
pVehicle->m_nZoneLevel = LEVEL_IGNORE;
else
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(pVehicle->GetPosition());
return 0;

View File

@ -26,8 +26,7 @@ enum eEventType
EVENT_ICECREAM,
EVENT_ATM,
EVENT_SHOPSTALL, // used on graffitis
EVENT_SHOPWINDOW,
EVENT_LAST_EVENT // may be above one
EVENT_LAST_EVENT
};
enum eEventEntity

View File

@ -2,6 +2,7 @@
enum eLevelName
{
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
LEVEL_NONE = 0,
LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL,

View File

@ -548,10 +548,10 @@ CPlayerInfo::Process(void)
}
if (FindPlayerVehicle()) {
CVehicle *veh = FindPlayerVehicle();
veh->m_nZoneLevel = -1;
veh->m_nZoneLevel = LEVEL_IGNORE;
for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) {
if (veh->pPassengers[i])
veh->pPassengers[i]->m_nZoneLevel = 0;
veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE;
}
CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled;
} else {

View File

@ -251,7 +251,7 @@ INITSAVEBUF
continue;
if (pObject->ObjectCreatedBy == MISSION_OBJECT) {
bool bIsPickup = pObject->bIsPickup;
bool bFlag2 = pObject->m_obj_flag2;
bool bPickupObjWithMessage = pObject->bPickupObjWithMessage;
bool bOutOfStock = pObject->bOutOfStock;
bool bGlassCracked = pObject->bGlassCracked;
bool bGlassBroken = pObject->bGlassBroken;
@ -269,7 +269,7 @@ INITSAVEBUF
WriteSaveBuf(buf, (uint32)0); // same
WriteSaveBuf(buf, pObject->ObjectCreatedBy);
WriteSaveBuf(buf, bIsPickup);
WriteSaveBuf(buf, bFlag2);
WriteSaveBuf(buf, bPickupObjWithMessage);
WriteSaveBuf(buf, bOutOfStock);
WriteSaveBuf(buf, bGlassCracked);
WriteSaveBuf(buf, bGlassBroken);
@ -305,7 +305,7 @@ INITSAVEBUF
ReadSaveBuf<uint32>(buf);
pBufferObject->ObjectCreatedBy = ReadSaveBuf<int8>(buf);
pBufferObject->bIsPickup = ReadSaveBuf<bool>(buf);
pBufferObject->m_flagE2 = ReadSaveBuf<bool>(buf);
pBufferObject->bPickupObjWithMessage = ReadSaveBuf<bool>(buf);
pBufferObject->bOutOfStock = ReadSaveBuf<bool>(buf);
pBufferObject->bGlassCracked = ReadSaveBuf<bool>(buf);
pBufferObject->bGlassBroken = ReadSaveBuf<bool>(buf);
@ -325,7 +325,7 @@ INITSAVEBUF
pObject->m_objectMatrix = pBufferObject->m_objectMatrix;
pObject->ObjectCreatedBy = pBufferObject->ObjectCreatedBy;
pObject->bIsPickup = pBufferObject->bIsPickup;
pObject->m_flagE2 = pBufferObject->m_flagE2;
pObject->bPickupObjWithMessage = pBufferObject->bPickupObjWithMessage;
pObject->bOutOfStock = pBufferObject->bOutOfStock;
pObject->bGlassCracked = pBufferObject->bGlassCracked;
pObject->bGlassBroken = pBufferObject->bGlassBroken;

View File

@ -161,7 +161,7 @@ enum Config {
# define GTA3_1_1_PATCH
//# define GTA3_STEAM_PATCH
# ifdef GTA_PS2_STUFF
//# define USE_PS2_RAND // this is unsafe until we have the game reversed
# define USE_PS2_RAND
# define RANDOMSPLASH // use random splash as on PS2
# define PS2_MATFX
# endif

View File

@ -40,25 +40,25 @@ public:
uint32 m_status : 5;
// flagsA
uint32 bUsesCollision : 1;
uint32 bCollisionProcessed : 1;
uint32 bIsStatic : 1;
uint32 bHasContacted : 1;
uint32 bUsesCollision : 1; // does entity use collision
uint32 bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function
uint32 bIsStatic : 1; // is entity static
uint32 bHasContacted : 1; // has entity processed some contact forces
uint32 bPedPhysics : 1;
uint32 bIsStuck : 1;
uint32 bIsInSafePosition : 1;
uint32 bIsStuck : 1; // is entity stuck
uint32 bIsInSafePosition : 1; // is entity in a collision free safe position
uint32 bUseCollisionRecords : 1;
// flagsB
uint32 bWasPostponed : 1;
uint32 bWasPostponed : 1; // was entity control processing postponed
uint32 bExplosionProof : 1;
uint32 bIsVisible : 1;
uint32 bHasCollided : 1; //
uint32 bIsVisible : 1; //is the entity visible
uint32 bHasCollided : 1;
uint32 bRenderScorched : 1;
uint32 bHasBlip : 1;
uint32 bIsBIGBuilding : 1;
uint32 bIsBIGBuilding : 1; // Set if this entity is a big building
// VC inserts one more flag here: if drawdist <= 2000
uint32 bRenderDamaged : 1;
uint32 bRenderDamaged : 1; // use damaged LOD models for objects with applicable damage
// flagsC
uint32 bBulletProof : 1;
@ -66,22 +66,22 @@ public:
uint32 bCollisionProof : 1;
uint32 bMeleeProof : 1;
uint32 bOnlyDamagedByPlayer : 1;
uint32 bStreamingDontDelete : 1;
uint32 bStreamingDontDelete : 1; // Dont let the streaming remove this
uint32 bZoneCulled : 1;
uint32 bZoneCulled2 : 1; // only treadables+10m
uint32 bZoneCulled2 : 1; // only treadables+10m
// flagsD
uint32 bRemoveFromWorld : 1;
uint32 bHasHitWall : 1;
uint32 bImBeingRendered : 1;
uint32 bRemoveFromWorld : 1; // remove this entity next time it should be processed
uint32 bHasHitWall : 1; // has collided with a building (changes subsequent collisions)
uint32 bImBeingRendered : 1; // don't delete me because I'm being rendered
uint32 bTouchingWater : 1; // used by cBuoyancy::ProcessBuoyancy
uint32 bIsSubway : 1; // set when subway, but maybe different meaning?
uint32 bDrawLast : 1;
uint32 bDrawLast : 1; // draw object last
uint32 bNoBrightHeadLights : 1;
uint32 bDoNotRender : 1;
// flagsE
uint32 bDistanceFade : 1;
uint32 bDistanceFade : 1; // Fade entity because it is far away
uint32 m_flagE2 : 1;
uint16 m_scanCode;

View File

@ -36,7 +36,7 @@ CPhysical::CPhysical(void)
for(i = 0; i < 6; i++)
m_aCollisionRecords[i] = nil;
field_EF = false;
m_bIsVehicleBeingShifted = false;
m_nDamagePieceType = 0;
m_fDamageImpulse = 0.0f;
@ -63,7 +63,7 @@ CPhysical::CPhysical(void)
m_phy_flagA10 = false;
m_phy_flagA20 = false;
m_nZoneLevel = 0;
m_nZoneLevel = LEVEL_NONE;
}
CPhysical::~CPhysical(void)
@ -1767,13 +1767,13 @@ CPhysical::ProcessShift(void)
CWorld::AdvanceCurrentScanCode();
if(IsVehicle())
field_EF = true;
m_bIsVehicleBeingShifted = true;
CEntryInfoNode *node;
bool hasshifted = false; // whatever that means...
for(node = m_entryInfoList.first; node; node = node->next)
hasshifted |= ProcessShiftSectorList(node->sector->m_lists);
field_EF = false;
m_bIsVehicleBeingShifted = false;
if(hasshifted){
CWorld::AdvanceCurrentScanCode();
for(node = m_entryInfoList.first; node; node = node->next)
@ -1799,7 +1799,7 @@ CPhysical::ProcessCollision(void)
CPed *ped = (CPed*)this;
m_fDistanceTravelled = 0.0f;
field_EF = 0;
m_bIsVehicleBeingShifted = false;
m_phy_flagA80 = false;
if(!bUsesCollision){
@ -1912,7 +1912,7 @@ CPhysical::ProcessCollision(void)
ApplyMoveSpeed();
ApplyTurnSpeed();
GetMatrix().Reorthogonalise();
field_EF = 0;
m_bIsVehicleBeingShifted = false;
m_phy_flagA80 = false;
if(!m_vecMoveSpeed.IsZero() ||
!m_vecTurnSpeed.IsZero() ||

View File

@ -40,7 +40,7 @@ public:
char field_EC;
uint8 m_nStaticFrames;
uint8 m_nCollisionRecords;
bool field_EF;
bool m_bIsVehicleBeingShifted;
CEntity *m_aCollisionRecords[PHYSICAL_MAX_COLLISIONRECORDS];
float m_fDistanceTravelled;
@ -55,8 +55,8 @@ public:
uint8 bAffectedByGravity : 1;
uint8 bInfiniteMass : 1;
uint8 bIsInWater : 1;
uint8 m_phy_flagA10 : 1;
uint8 m_phy_flagA20 : 1;
uint8 m_phy_flagA10 : 1; // unused
uint8 m_phy_flagA20 : 1; // unused
uint8 bHitByTrain : 1;
uint8 m_phy_flagA80 : 1;

View File

@ -35,7 +35,7 @@ CObject::CObject(void)
m_colour1 = m_colour2;
m_nBonusValue = 0;
bIsPickup = false;
m_obj_flag2 = false;
bPickupObjWithMessage = false;
bOutOfStock = false;
bGlassCracked = false;
bGlassBroken = false;
@ -315,7 +315,7 @@ CObject::Init(void)
ObjectCreatedBy = GAME_OBJECT;
bIsStatic = true;
bIsPickup = false;
m_obj_flag2 = false;
bPickupObjWithMessage = false;
bOutOfStock = false;
bGlassCracked = false;
bGlassBroken = false;

View File

@ -47,13 +47,12 @@ public:
float m_fUprootLimit;
int8 ObjectCreatedBy;
int8 bIsPickup : 1;
int8 m_obj_flag2 : 1;
int8 bPickupObjWithMessage : 1;
int8 bOutOfStock : 1;
int8 bGlassCracked : 1;
int8 bGlassBroken : 1;
int8 bHasBeenDamaged : 1;
int8 bUseVehicleColours : 1;
int8 m_obj_flag80 : 1;
int8 m_nBonusValue;
float m_fCollisionDamageMultiplier;
uint8 m_nCollisionDamageEffect;

View File

@ -63,7 +63,7 @@ CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
m_bIsInPursuit = false;
field_1350 = 1;
m_bIsDisabledCop = false;
field_1356 = 0;
m_fAbseilPos = 0.0f;
m_attackTimer = 0;
m_bBeatingSuspect = false;
m_bStopAndShootDisabledZone = false;
@ -668,11 +668,13 @@ CCopPed::ProcessControl(void)
}
if (bDuckAndCover) {
#if !defined(GTA3_1_1_PATCH) && !defined(VC_PED_PORTS)
if (!bNotAllowedToDuck && Seek()) {
SetMoveState(PEDMOVE_STILL);
SetMoveAnim();
SetPointGunAt(m_pedInObjective);
}
#endif
} else if (Seek()) {
CVehicle *playerVeh = FindPlayerVehicle();
if (!playerVeh && player && player->EnteringCar()) {

View File

@ -20,12 +20,9 @@ public:
bool m_bBeatingSuspect;
bool m_bStopAndShootDisabledZone;
bool m_bZoneDisabled;
int32 field_1356;
float m_fAbseilPos; // VC leftover, unused
eCopType m_nCopType;
int8 field_1364;
int8 field_1365;
int8 field_1366;
int8 field_1367;
CCopPed(eCopType);
~CCopPed();

View File

@ -22,13 +22,12 @@ enum EmergencyPedState
class CEmergencyPed : public CPed
{
public:
// 0x53C
CPed *m_pRevivedPed;
EmergencyPedState m_nEmergencyPedState;
CAccident *m_pAttendedAccident;
CFire *m_pAttendedFire;
bool m_bStartedToCPR; // set but unused(?)
int32 field_1360; // also something for medics, unused(?)
bool m_bStartedToCPR; // set but unused
int32 field_1360; // set to 0 but unused
CEmergencyPed(uint32);
~CEmergencyPed() { }

View File

@ -9191,8 +9191,11 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
ped->QuitEnteringCar();
return;
}
bool itsVan = veh->bIsVan;
bool itsBus = veh->bIsBus;
bool itsVan = !!veh->bIsVan;
bool itsBus = !!veh->bIsBus;
#ifdef FIX_BUGS
bool itsLow = !!veh->bLowVehicle;
#endif
eDoors enterDoor;
AnimationId enterAnim;
@ -9227,6 +9230,10 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
enterAnim = ANIM_VAN_GETIN;
} else if (itsBus) {
enterAnim = ANIM_COACH_IN_R;
#ifdef FIX_BUGS
} else if (itsLow) {
enterAnim = ANIM_CAR_GETIN_LOW_RHS;
#endif
} else {
enterAnim = ANIM_CAR_GETIN_RHS;
}
@ -9234,6 +9241,10 @@ CPed::PedAnimAlignCB(CAnimBlendAssociation *animAssoc, void *arg)
enterAnim = ANIM_VAN_GETIN_L;
} else if (itsBus) {
enterAnim = ANIM_COACH_IN_L;
#ifdef FIX_BUGS
} else if (itsLow) {
enterAnim = ANIM_CAR_GETIN_LOW_LHS;
#endif
} else {
enterAnim = ANIM_CAR_GETIN_LHS;
}
@ -10806,6 +10817,11 @@ CPed::PedAnimDoorOpenCB(CAnimBlendAssociation* animAssoc, void* arg)
}
}
}
#ifdef CANCELLABLE_CAR_ENTER
if (!veh->IsDoorMissing(door) && veh->CanPedOpenLocks(ped) && veh->IsCar()) {
((CAutomobile*)veh)->Damage.SetDoorStatus(door, DOOR_STATUS_SWINGING);
}
#endif
ped->QuitEnteringCar();
ped->RestorePreviousObjective();
ped->bCancelEnteringCar = false;
@ -14492,7 +14508,8 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
if (collidingEnt->IsVehicle() && ((CVehicle*)collidingEnt)->IsBoat())
collidedWithBoat = true;
if (!field_EF && !m_phy_flagA80
// ofc we're not vehicle
if (!m_bIsVehicleBeingShifted && !m_phy_flagA80
#ifdef VC_PED_PORTS
&& !collidingEnt->IsPed()
#endif
@ -15259,7 +15276,7 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode)
{
uint32 optedDoorNode = wantedDoorNode;
bool teleportNeeded = false;
bool isLow = veh->bLowVehicle;
bool isLow = !!veh->bLowVehicle;
if (!veh->CanPedExitCar()) {
if (veh->pDriver && !veh->pDriver->IsPlayer()) {
veh->AutoPilot.m_nCruiseSpeed = 0;

View File

@ -435,7 +435,7 @@ public:
float m_fRotationCur;
float m_fRotationDest;
float m_headingRate;
uint16 m_vehEnterType; // TODO: this is more like a door, not a type
uint16 m_vehEnterType;
int16 m_walkAroundType;
CPhysical *m_pCurrentPhysSurface;
CVector m_vecOffsetFromPhysSurface;

View File

@ -159,12 +159,12 @@ void CMovingThings::Update()
int block = CTimer::GetFrameCounter() % TIME_SPAN;
for (i = (block * NUMMOVINGTHINGS) / TIME_SPAN; i < ((block + 1) * NUMMOVINGTHINGS) / TIME_SPAN; i++) {
if (aMovingThings[i].field_A == 1)
if (aMovingThings[i].m_nHidden == 1)
aMovingThings[i].Update();
}
for (i = 0; i < CMovingThings::Num; i++) {
if (aMovingThings[i].field_A == 0)
if (aMovingThings[i].m_nHidden == 0)
aMovingThings[i].Update();
}
@ -212,14 +212,14 @@ void CMovingThing::Update()
m_pEntity->UpdateRwFrame();
if (SQR(m_pEntity->GetPosition().x - TheCamera.GetPosition().x) + SQR(m_pEntity->GetPosition().y - TheCamera.GetPosition().y) < 40000.0f) {
if (field_A == 1) {
if (m_nHidden == 1) {
AddToList(&CMovingThings::StartCloseList);
field_A = 0;
m_nHidden = 0;
}
} else {
if (field_A == 0) {
if (m_nHidden == 0) {
RemoveFromList();
field_A = 1;
m_nHidden = 1;
}
}
}

View File

@ -8,7 +8,7 @@ public:
CMovingThing *m_pNext;
CMovingThing *m_pPrev;
int16 m_nType;
int16 field_A;
int16 m_nHidden;
CVector m_vecPosn;
CEntity* m_pEntity;

View File

@ -90,7 +90,7 @@ public:
static void AddJetExplosion(CVector const &vecPos, float fPower, float fSize);
static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix);
#ifndef MASTER
#ifdef TOGGLEABLE_BETA_FEATURES
static bool bEnableBannedParticles;
#endif
};

View File

@ -98,7 +98,7 @@ CPager::AddMessage(wchar *str, uint16 speed, uint16 priority, uint16 a5)
m_messages[i].m_pText = str;
m_messages[i].m_nSpeedMs = speed;
m_messages[i].m_nPriority = priority;
m_messages[i].field_10 = a5;
m_messages[i].unused = a5;
m_messages[i].m_nCurrentPosition = -(m_nNumDisplayLetters + 10);
m_messages[i].m_nTimeToChangePosition = CTimer::GetTimeInMilliseconds() + speed;
m_messages[i].m_nStringLength = size;
@ -142,7 +142,7 @@ CPager::AddMessageWithNumber(wchar *str, int32 n1, int32 n2, int32 n3, int32 n4,
m_messages[i].m_pText = str;
m_messages[i].m_nSpeedMs = speed;
m_messages[i].m_nPriority = priority;
m_messages[i].field_10 = a11;
m_messages[i].unused = a11;
m_messages[i].m_nCurrentPosition = -(m_nNumDisplayLetters + 10);
m_messages[i].m_nTimeToChangePosition = CTimer::GetTimeInMilliseconds() + speed;
m_messages[i].m_nStringLength = size;

View File

@ -7,7 +7,7 @@ struct PagerMessage {
uint16 m_nStringLength;
uint16 m_nPriority;
uint32 m_nTimeToChangePosition;
int16 field_10;
int16 unused; // but still set in SCM. importance? ringtone?
int32 m_nNumber[6];
};

View File

@ -562,7 +562,7 @@ CAutomobile::ProcessControl(void)
bWasPostponed = false;
bHasHitWall = false;
m_fDistanceTravelled = 0.0f;
field_EF = false;
m_bIsVehicleBeingShifted = false;
m_phy_flagA80 = false;
ApplyMoveSpeed();
ApplyTurnSpeed();
@ -2148,7 +2148,7 @@ CAutomobile::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints)
// m_aSuspensionSpringRatio are now set to the point where the tyre touches ground.
// In ProcessControl these will be re-normalized to ignore the tyre radius.
if(field_EF || m_phy_flagA80 ||
if(m_bIsVehicleBeingShifted || m_phy_flagA80 ||
GetModelIndex() == MI_DODO && (ent->IsPed() || ent->IsVehicle())){
// don't do line collision
for(i = 0; i < 4; i++)

View File

@ -101,7 +101,7 @@ struct tHandlingData
float fSteeringLock;
float fTractionLoss;
float fTractionBias;
uint32 field_AC;
float fABS; // should be VC leftover
float fSuspensionForceLevel;
float fSuspensionDampingLevel;
float fSuspensionUpperLimit;
@ -126,7 +126,7 @@ private:
float field_C; // unused it seems
float field_10; //
tHandlingData HandlingData[NUMHANDLINGS];
uint32 field_302C; // unused it seems, padding?
uint32 field_302C; // unused it seems
public:
cHandlingDataMgr(void);

View File

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

View File

@ -38,7 +38,6 @@ public:
uint8 m_b1stPerson : 1;
uint8 m_bHeavy : 1;
uint8 m_bThrow : 1;
uint8 stuff;
static void Initialise(void);
static void LoadWeaponData(void);