From 32f2f3511c1a6d74c1347542f8c1b76f40677e01 Mon Sep 17 00:00:00 2001 From: nmzik Date: Fri, 18 Oct 2019 15:36:40 +0300 Subject: CPopulation::Initialise() --- src/control/Population.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'src/control/Population.cpp') diff --git a/src/control/Population.cpp b/src/control/Population.cpp index 3e7ab427..39c2b57d 100644 --- a/src/control/Population.cpp +++ b/src/control/Population.cpp @@ -11,15 +11,73 @@ int32 &CPopulation::m_AllRandomPedsThisType = *(int32*)0x5FA570; float &CPopulation::PedDensityMultiplier = *(float*)0x5FA56C; uint32 &CPopulation::ms_nTotalMissionPeds = *(uint32*)0x8F5F70; int32 &CPopulation::MaxNumberOfPedsInUse = *(int32*)0x5FA574; +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; +WRAPPER void CPopulation::LoadPedGroups() { EAXJMP(0x4F3870); } WRAPPER void CPopulation::UpdatePedCount(uint32, bool) { EAXJMP(0x4F5A60); } WRAPPER void CPopulation::DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool) { EAXJMP(0x4F6200); } WRAPPER CPed *CPopulation::AddPedInCar(CVehicle *vehicle) { EAXJMP(0x4F5800); } WRAPPER bool CPopulation::IsPointInSafeZone(CVector *coors) { EAXJMP(0x4F60C0); } +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"); +} + void CPopulation::RemovePed(CEntity* ent) { CWorld::Remove(ent); delete ent; } + +STARTPATCHES +InjectHook(0x4F3770, CPopulation::Initialise, PATCH_JUMP); +ENDPATCHES \ No newline at end of file -- cgit v1.2.3 From f56684d04e06af21f423ad4bc1c47bc2b09fccea Mon Sep 17 00:00:00 2001 From: nmzik Date: Sat, 19 Oct 2019 01:23:40 +0300 Subject: CGame::Process() && CGame::ReloadIPLs --- src/control/Population.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/control/Population.cpp') diff --git a/src/control/Population.cpp b/src/control/Population.cpp index 39c2b57d..a98721ac 100644 --- a/src/control/Population.cpp +++ b/src/control/Population.cpp @@ -31,6 +31,7 @@ uint32& CPopulation::ms_nNumGang9 = *(uint32*)0x8F1B10; uint32& CPopulation::ms_nNumGang7 = *(uint32*)0x8F1B28; uint32& CPopulation::ms_nNumGang8 = *(uint32*)0x8F1B0C; +WRAPPER void CPopulation::Update(void) { EAXJMP(0x4F39A0); } WRAPPER void CPopulation::LoadPedGroups() { EAXJMP(0x4F3870); } WRAPPER void CPopulation::UpdatePedCount(uint32, bool) { EAXJMP(0x4F5A60); } WRAPPER void CPopulation::DealWithZoneChange(eLevelName oldLevel, eLevelName newLevel, bool) { EAXJMP(0x4F6200); } -- cgit v1.2.3