fixing some uninitialized stuff

This commit is contained in:
Nikolay Korolev 2020-06-06 13:31:09 +03:00
parent 408f47fc9d
commit 3f26250d73
8 changed files with 31 additions and 2 deletions

View File

@ -11763,7 +11763,11 @@ void CTheScripts::UpdateObjectIndices()
if (!pModel)
continue;
strcpy(name, pModel->GetName());
#ifdef FIX_BUGS
for (int k = 0; k < USED_OBJECT_NAME_LENGTH && name[k]; k++)
#else
for (int k = 0; k < USED_OBJECT_NAME_LENGTH; k++)
#endif
name[k] = toupper(name[k]);
if (strcmp(name, UsedObjectArray[i].name) == 0) {
found = true;

View File

@ -63,6 +63,9 @@ CPhysical::CPhysical(void)
m_phy_flagA10 = false;
m_phy_flagA20 = false;
#ifdef FIX_BUGS
m_nSurfaceTouched = SURFACE_DEFAULT;
#endif
m_nZoneLevel = LEVEL_NONE;
}

View File

@ -30,7 +30,11 @@ public:
RwMatrixDestroy(m_attachment);
}
void Attach(RwMatrix *matrix, bool owner = false){
#ifdef FIX_BUGS
if(m_attachment && m_hasRwMatrix)
#else
if(m_hasRwMatrix && m_attachment)
#endif
RwMatrixDestroy(m_attachment);
m_attachment = matrix;
m_hasRwMatrix = owner;

View File

@ -187,6 +187,9 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
m_queuedSound = SOUND_NO_SOUND;
m_objective = OBJECTIVE_NONE;
m_prevObjective = OBJECTIVE_NONE;
#ifdef FIX_BUGS
m_objectiveTimer = 0;
#endif
CharCreatedBy = RANDOM_CHAR;
m_leader = nil;
m_pedInObjective = nil;

View File

@ -35,6 +35,9 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
{
m_fMoveSpeed = 0.0f;
SetModelIndex(MI_PLAYER);
#ifdef FIX_BUGS
m_fCurrentStamina = m_fMaxStamina = 150.0f;
#endif
SetInitialState();
m_pWanted = new CWanted();
@ -46,8 +49,9 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
m_bSpeedTimerFlag = false;
m_pPointGunAt = nil;
m_nPedState = PED_IDLE;
m_fMaxStamina = 150.0f;
m_fCurrentStamina = m_fMaxStamina;
#ifndef FIX_BUGS
m_fCurrentStamina = m_fMaxStamina = 150.0f;
#endif
m_fStaminaProgress = 0.0f;
m_nEvadeAmount = 0;
field_1367 = 0;

View File

@ -84,6 +84,10 @@ CPlane::CPlane(int32 id, uint8 CreatedBy)
SetStatus(STATUS_PLANE);
bIsBIGBuilding = true;
m_level = LEVEL_NONE;
#ifdef FIX_BUGS
m_isFarAway = true;
#endif
}
CPlane::~CPlane()

View File

@ -63,6 +63,10 @@ CTrain::CTrain(int32 id, uint8 CreatedBy)
bUsesCollision = true;
SetStatus(STATUS_TRAIN_MOVING);
#ifdef FIX_BUGS
m_isFarAway = true;
#endif
}
void

View File

@ -59,6 +59,9 @@ CVehicle::CVehicle(uint8 CreatedBy)
bIsLawEnforcer = false;
bIsAmbulanceOnDuty = false;
bIsFireTruckOnDuty = false;
#ifdef FIX_BUGS
bIsHandbrakeOn = false;
#endif
CCarCtrl::UpdateCarCount(this, false);
m_fHealth = 1000.0f;
bEngineOn = true;