summaryrefslogtreecommitdiffstats
path: root/src/control/PedType.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-19 12:30:34 +0200
committerGitHub <noreply@github.com>2019-06-19 12:30:34 +0200
commitf8438e8ab6b7de932ac6cf20ca2e1e70810b0030 (patch)
treee12607035cf235f3d71979ba006b4a69bba31564 /src/control/PedType.cpp
parentsilly mistake in CFileLoader (diff)
parentCPed merge fixes (diff)
downloadre3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar.gz
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar.bz2
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar.lz
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar.xz
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.tar.zst
re3-f8438e8ab6b7de932ac6cf20ca2e1e70810b0030.zip
Diffstat (limited to 'src/control/PedType.cpp')
-rw-r--r--src/control/PedType.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/control/PedType.cpp b/src/control/PedType.cpp
index 587aa815..b6d77cb0 100644
--- a/src/control/PedType.cpp
+++ b/src/control/PedType.cpp
@@ -2,4 +2,31 @@
#include "patcher.h"
#include "PedType.h"
-WRAPPER int32 CPedType::FindPedType(char *type) { EAXJMP(0x4EEC10); }
+CPedType* (&CPedType::ms_apPedType)[23] = *(CPedType * (*)[23]) * (int*)0x941594;
+
+WRAPPER void CPedType::LoadPedData(void) { EAXJMP(0x4EE8D0); }
+WRAPPER int32 CPedType::FindPedType(char* type) { EAXJMP(0x4EEC10); }
+
+void
+CPedType::Initialise()
+{
+ debug("Initialising CPedType...\n");
+ for (int i = 0; i < 23; i++) {
+ ms_apPedType[i] = new CPedType;
+ ms_apPedType[i]->m_Type.IntValue = 1;
+ ms_apPedType[i]->field_4 = 0;
+ ms_apPedType[i]->field_8 = 0;
+ // Why field_C not initialized?
+ ms_apPedType[i]->field_10 = 0;
+ ms_apPedType[i]->field_14 = 0;
+ ms_apPedType[i]->m_Threat.IntValue = 0;
+ ms_apPedType[i]->m_Avoid.IntValue = 0;
+ }
+ debug("Loading ped data...\n");
+ LoadPedData();
+ debug("CPedType ready\n");
+}
+
+STARTPATCHES
+ InjectHook(0x4EE7E0, &CPedType::Initialise, PATCH_JUMP);
+ENDPATCHES \ No newline at end of file