1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 04:40:00 +00:00

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) if (!pModel)
continue; continue;
strcpy(name, pModel->GetName()); 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++) for (int k = 0; k < USED_OBJECT_NAME_LENGTH; k++)
#endif
name[k] = toupper(name[k]); name[k] = toupper(name[k]);
if (strcmp(name, UsedObjectArray[i].name) == 0) { if (strcmp(name, UsedObjectArray[i].name) == 0) {
found = true; found = true;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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