re3/src/control/Population.cpp

84 lines
2.9 KiB
C++
Raw Normal View History

2019-06-13 00:35:26 +00:00
#include "common.h"
2019-06-24 22:42:23 +00:00
#include "patcher.h"
2019-06-28 17:23:28 +00:00
#include "Game.h"
2019-09-12 00:43:18 +00:00
#include "World.h"
#include "Entity.h"
2019-06-13 00:35:26 +00:00
#include "Population.h"
2019-06-28 10:34:02 +00:00
PedGroup *CPopulation::ms_pPedGroups = (PedGroup*)0x6E9248;
2019-06-24 22:42:23 +00:00
bool &CPopulation::ms_bGivePedsWeapons = *(bool*)0x95CCF6;
2019-07-03 22:16:24 +00:00
int32 &CPopulation::m_AllRandomPedsThisType = *(int32*)0x5FA570;
float &CPopulation::PedDensityMultiplier = *(float*)0x5FA56C;
2019-07-14 09:49:03 +00:00
uint32 &CPopulation::ms_nTotalMissionPeds = *(uint32*)0x8F5F70;
2019-08-06 21:32:19 +00:00
int32 &CPopulation::MaxNumberOfPedsInUse = *(int32*)0x5FA574;
2019-10-18 12:36:40 +00:00
uint32& CPopulation::ms_nNumCivMale = *(uint32*)0x8F2548;
uint32& CPopulation::ms_nNumCivFemale = *(uint32*)0x8F5F44;
uint32& CPopulation::ms_nNumCop = *(uint32*)0x885AFC;
bool& CPopulation::bZoneChangeHasHappened = *(bool*)0x95CD79;
uint32& CPopulation::ms_nNumEmergency = *(uint32*)0x94071C;
uint32& CPopulation::m_CountDownToPedsAtStart = *(uint32*)0x95CD4F;
uint32& CPopulation::ms_nNumGang1 = *(uint32*)0x8F1B1C;
uint32& CPopulation::ms_nNumGang2 = *(uint32*)0x8F1B14;
uint32& CPopulation::ms_nTotalPeds = *(uint32*)0x95CB50;
uint32& CPopulation::ms_nNumGang3 = *(uint32*)0x8F2548;
uint32& CPopulation::ms_nTotalGangPeds = *(uint32*)0x885AF0;
uint32& CPopulation::ms_nNumGang4 = *(uint32*)0x8F1B2C;
uint32& CPopulation::ms_nTotalCivPeds = *(uint32*)0x8F2C3C;
uint32& CPopulation::ms_nNumGang5 = *(uint32*)0x8F1B30;
uint32& CPopulation::ms_nNumDummy = *(uint32*)0x8F1A98;
uint32& CPopulation::ms_nNumGang6 = *(uint32*)0x8F1B20;
uint32& CPopulation::ms_nNumGang9 = *(uint32*)0x8F1B10;
uint32& CPopulation::ms_nNumGang7 = *(uint32*)0x8F1B28;
uint32& CPopulation::ms_nNumGang8 = *(uint32*)0x8F1B0C;
2019-06-24 22:42:23 +00:00
2019-10-18 22:23:40 +00:00
WRAPPER void CPopulation::Update(void) { EAXJMP(0x4F39A0); }
2019-10-18 12:36:40 +00:00
WRAPPER void CPopulation::LoadPedGroups() { EAXJMP(0x4F3870); }
2019-06-28 10:34:02 +00:00
WRAPPER void CPopulation::UpdatePedCount(uint32, bool) { EAXJMP(0x4F5A60); }
2019-06-28 17:23:28 +00:00
WRAPPER void CPopulation::DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool) { EAXJMP(0x4F6200); }
2019-07-05 12:23:39 +00:00
WRAPPER CPed *CPopulation::AddPedInCar(CVehicle *vehicle) { EAXJMP(0x4F5800); }
WRAPPER bool CPopulation::IsPointInSafeZone(CVector *coors) { EAXJMP(0x4F60C0); }
2019-09-12 00:43:18 +00:00
2019-10-18 12:36:40 +00:00
void
CPopulation::Initialise()
{
debug("Initialising CPopulation...\n");
ms_nNumCivMale = 0;
m_AllRandomPedsThisType = -1;
ms_nNumCivFemale = 0;
PedDensityMultiplier = 1.0;
ms_nNumCop = 0;
bZoneChangeHasHappened = 0;
ms_nNumEmergency = 0;
m_CountDownToPedsAtStart = 2;
ms_nNumGang1 = 0;
ms_nTotalMissionPeds = 0;
ms_nNumGang2 = 0;
ms_nTotalPeds = 0;
ms_nNumGang3 = 0;
ms_nTotalGangPeds = 0;
ms_nNumGang4 = 0;
ms_nTotalCivPeds = 0;
ms_nNumGang5 = 0;
ms_nNumDummy = 0;
ms_nNumGang6 = 0;
ms_nNumGang9 = 0;
ms_nNumGang7 = 0;
ms_nNumGang8 = 0;
LoadPedGroups();
DealWithZoneChange(LEVEL_COMMERCIAL, LEVEL_INDUSTRIAL, true);
debug("CPopulation ready\n");
}
2019-09-12 00:43:18 +00:00
void
CPopulation::RemovePed(CEntity* ent)
{
CWorld::Remove(ent);
delete ent;
}
2019-10-18 12:36:40 +00:00
STARTPATCHES
InjectHook(0x4F3770, CPopulation::Initialise, PATCH_JUMP);
ENDPATCHES