--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
598 lines
32 KiB
C++
598 lines
32 KiB
C++
#include "classes.h"
|
|
|
|
// 006f0090
|
|
Entity * EntityFactory::Create(uint32_t type, uint8_t force)
|
|
{
|
|
char cVar1;
|
|
uint32_t slot;
|
|
uint32_t tries;
|
|
uint8_t *npcPool;
|
|
bool isRetrying;
|
|
|
|
if (GHIDRA_INT(type) < 0x3e9) {
|
|
if (type == 1000) {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) + 1U & 0x3ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x130000)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((slot * 0x4c0 + 0x170 + GHIDRA_INT(this)));
|
|
if (cVar1 == '\0') goto LAB_006f0d18;
|
|
isRetrying = tries < 0x401;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((slot * 0x4c0 + GHIDRA_INT(this))) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) + 1U & 0x3ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x130000)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((slot * 0x4c0 + GHIDRA_INT(this))) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x400;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) * 0x4c0 + GHIDRA_INT(this))) + 0x38))
|
|
();
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5db84,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) * 0x4c0 + 0x177 + GHIDRA_INT(this))) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) * 0x4c0 + GHIDRA_INT(this))) + 0x28))();
|
|
(**(code **)(*GHIDRA_CAST<int *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) * 0x4c0 + GHIDRA_INT(this))) + 0x44))();
|
|
*GHIDRA_CAST<uint8_t *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x130000)) * 0x4c0 + 0x177 + GHIDRA_INT(this))) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x130000));
|
|
}
|
|
LAB_006f0d18:
|
|
return GHIDRA_CAST<Entity *>((slot * 0x4c0 + GHIDRA_INT(this)));
|
|
}
|
|
switch(type) {
|
|
case 1:
|
|
KAGE_LogMessage(0x10,GHIDRA_CAST<uint8_t *>("EntityFactory cannot spawn Entity_Player.\n"));
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
case 2:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x32c820)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x848 + 0x223990));
|
|
if (cVar1 == '\0') goto LAB_006f0638;
|
|
isRetrying = tries < 0x201;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x848 + 0x223820)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x32c820)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x848 + 0x223820)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x200;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) * 0x848 + 0x223820)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5db4c,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) * 0x848 + 0x223997)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) * 0x848 + 0x223820)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) * 0x848 + 0x223820)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x32c820)) * 0x848 + 0x223997)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x32c820));
|
|
}
|
|
LAB_006f0638:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x848 + 0x223820));
|
|
case 3:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x16d208)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0xf48 + 0x130178));
|
|
if (cVar1 == '\0') goto LAB_006f021a;
|
|
isRetrying = tries < 0x41;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0xf48 + 0x130008)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x16d208)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0xf48 + 0x130008)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x40;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) * 0xf48 + 0x130008)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5daa4,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) * 0xf48 + 0x13017f)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) * 0xf48 + 0x130008)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) * 0xf48 + 0x130008)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x16d208)) * 0xf48 + 0x13017f)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x16d208));
|
|
}
|
|
LAB_006f021a:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0xf48 + 0x130008));
|
|
case 4:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x194810)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x9d8 + 0x16d380));
|
|
if (cVar1 == '\0') goto LAB_006f0374;
|
|
isRetrying = tries < 0x41;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x9d8 + 0x16d210)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x194810)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x9d8 + 0x16d210)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x40;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) * 0x9d8 + 0x16d210)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dadc,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) * 0x9d8 + 0x16d387)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) * 0x9d8 + 0x16d210)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) * 0x9d8 + 0x16d210)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x194810)) * 0x9d8 + 0x16d387)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x194810));
|
|
}
|
|
LAB_006f0374:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x9d8 + 0x16d210));
|
|
case 5:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x435c30)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x6f0 + 0x357da0));
|
|
if (cVar1 == '\0') goto LAB_006f08f8;
|
|
isRetrying = tries < 0x201;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x6f0 + 0x357c30)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x435c30)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x6f0 + 0x357c30)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x200;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) * 0x6f0 + 0x357c30)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dc90,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) * 0x6f0 + 0x357da7)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) * 0x6f0 + 0x357c30)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) * 0x6f0 + 0x357c30)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x435c30)) * 0x6f0 + 0x357da7)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x435c30));
|
|
}
|
|
LAB_006f08f8:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x6f0 + 0x357c30));
|
|
case 6:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x460438)) = slot;
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT((&UNK_00435da8 + slot * 0x550)))) == '\0') goto LAB_006f0a56;
|
|
isRetrying = tries < 0x81;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT((&UNK_00435da8 + slot * 0x550)))) != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x550 + 0x435c38)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x460438)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x550 + 0x435c38)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x80;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) * 0x550 + 0x435c38)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dbbc,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT((&UNK_00435daf + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) * 0x550)))) =
|
|
1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) * 0x550 + 0x435c38)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) * 0x550 + 0x435c38)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + GHIDRA_INT((&UNK_00435daf + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x460438)) * 0x550)))) =
|
|
0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x460438));
|
|
}
|
|
LAB_006f0a56:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x550 + 0x435c38));
|
|
case 7:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x357c28)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x568 + 0x32c998));
|
|
if (cVar1 == '\0') goto LAB_006f0796;
|
|
isRetrying = tries < 0x81;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x568 + 0x32c828)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x357c28)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x568 + 0x32c828)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x80;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) * 0x568 + 0x32c828)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dc58,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) * 0x568 + 0x32c99f)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) * 0x568 + 0x32c828)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) * 0x568 + 0x32c828)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x357c28)) * 0x568 + 0x32c99f)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x357c28));
|
|
}
|
|
LAB_006f0796:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x568 + 0x32c828));
|
|
case 8:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x520 + 0x6965c8));
|
|
if (cVar1 == '\0') goto LAB_006f0bb4;
|
|
isRetrying = tries < 0x41;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x520 + 0x696458)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) + 1U & 0x3f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x520 + 0x696458)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x40;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) * 0x520 + 0x696458)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dcc8,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) * 0x520 + 0x6965cf)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) * 0x520 + 0x696458)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) * 0x520 + 0x696458)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) * 0x520 + 0x6965cf)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x6aac58));
|
|
}
|
|
LAB_006f0bb4:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x520 + 0x696458));
|
|
case 9:
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x223818)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x478 + 0x194988));
|
|
if (cVar1 == '\0') goto LAB_006f04d8;
|
|
isRetrying = tries < 0x201;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x478 + 0x194818)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x223818)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x478 + 0x194818)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x200;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_INT(this) +
|
|
*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) * 0x478 + 0x194818)) + 0x38))()
|
|
;
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5db10,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) * 0x478 + 0x19498f)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) * 0x478 + 0x194818)) + 0x28)
|
|
)();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) * 0x478 + 0x194818)) + 0x44)
|
|
)();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x223818)) * 0x478 + 0x19498f)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x223818));
|
|
}
|
|
LAB_006f04d8:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x478 + 0x194818));
|
|
}
|
|
}
|
|
else if (type == 0x2329) {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x675c48)) = slot;
|
|
cVar1 = *GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(this) + slot * 0x530 + 0x64c5b8));
|
|
if (cVar1 == '\0') goto LAB_006f0fe6;
|
|
isRetrying = tries < 0x81;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (cVar1 != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x530 + 0x64c448)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) + 1U & 0x7f;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x675c48)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + slot * 0x530 + 0x64c448)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x80;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) * 0x530 + 0x64c448))
|
|
+ 0x38))();
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Overwritten an entity with don\'t overwrite flag at index %d!\n");
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dc24,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n"
|
|
);
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) * 0x530 + 0x64c5bf)) = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) * 0x530 + 0x64c448)) + 0x28))
|
|
();
|
|
(**(code **)(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) * 0x530 + 0x64c448)) + 0x44))
|
|
();
|
|
*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(this) + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x675c48)) * 0x530 + 0x64c5bf)) = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x675c48));
|
|
}
|
|
LAB_006f0fe6:
|
|
return GHIDRA_CAST<Entity *>((GHIDRA_INT(this) + slot * 0x530 + 0x64c448));
|
|
}
|
|
npcPool = &DAT_00460440 + GHIDRA_INT(this);
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x64c440)) = slot;
|
|
if (npcPool[slot * 0xf60 + 0x170] == '\0') goto LAB_006f0e88;
|
|
isRetrying = tries < 0x201;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
if (npcPool[slot * 0xf60 + 0x170] != '\0') {
|
|
if (force != 0) {
|
|
return GHIDRA_CAST<Entity *>(0x0);
|
|
}
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((npcPool + slot * 0xf60)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
tries = 0;
|
|
do {
|
|
slot = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) + 1U & 0x1ff;
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x64c440)) = slot;
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((npcPool + slot * 0xf60)) + 0x38))();
|
|
if (cVar1 != '\0') break;
|
|
isRetrying = tries < 0x200;
|
|
tries = tries + 1;
|
|
} while (isRetrying);
|
|
cVar1 = (**(code **)(*GHIDRA_CAST<int *>((npcPool + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) * 0xf60)) + 0x38))();
|
|
if (cVar1 == '\0') {
|
|
KAGE_LogMessage(4,GHIDRA_CAST<uint8_t *>("Overwritten an entity with don\'t overwrite flag at index %d!\n"))
|
|
;
|
|
}
|
|
}
|
|
__std_type_info_name(0xc5dbf0,&DAT_00c71620);
|
|
KAGE_LogMessage(4,(uint8_t *)
|
|
"Entity pool array %s is full, overwriting at index %d! (frame count: %d)\n");
|
|
npcPool[*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) * 0xf60 + 0x177] = 1;
|
|
(**(code **)(*GHIDRA_CAST<int *>((npcPool + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) * 0xf60)) + 0x28))();
|
|
(**(code **)(*GHIDRA_CAST<int *>((npcPool + *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) * 0xf60)) + 0x44))();
|
|
npcPool[*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(this) + 0x64c440)) * 0xf60 + 0x177] = 0;
|
|
slot = *GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x64c440));
|
|
}
|
|
LAB_006f0e88:
|
|
return GHIDRA_CAST<Entity *>((npcPool + slot * 0xf60));
|
|
}
|
|
|
|
// 006f2a10
|
|
void EntityFactory::constructor()
|
|
{
|
|
void *local_10;
|
|
uint8_t *puStack_c;
|
|
uint32_t local_8;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00afbb39;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
_eh_vector_constructor_iterator_(this,0x4c0,0x400,Entity_Effect::constructor,FUN_005cda90);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x130000)) = 0;
|
|
local_8 = 0;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x130008),0xf48,0x40,Entity_Familiar::Constructor,FUN_0060d400);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x16d208)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 1;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x16d210),0x9d8,0x40,FUN_006a1e80,FUN_006a1fc0);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x194810)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 2;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x194818),0x478,0x200,Entity_Projectile::Constructor,
|
|
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_00652b80));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x223818)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 3;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x223820),0x848,0x200,Entity_Tear::Constructor,
|
|
Entity_Tear::~Entity_Tear);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x32c820)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 4;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x32c828),0x568,0x80,Entity_Laser::Constructor,
|
|
Entity_Laser::destructor);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x357c28)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 5;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x357c30),0x6f0,0x200,Entity_Pickup::Constructor,
|
|
Entity_Pickup::~Entity_Pickup);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x435c30)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 6;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x435c38),0x550,0x80,FUN_0065d0c0,FUN_0065d160);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x460438)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 7;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x460440),0xf60,0x200,Entity_NPC::Constructor,
|
|
Entity_NPC::~Entity_NPC);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x64c440)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 8;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x64c448),0x530,0x80,FUN_005ccc30,
|
|
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_005ccc90));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x675c48)) = 0;
|
|
(*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x0))) = 9;
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x675c50),0x410,0x80,FUN_006a7ec0,
|
|
GHIDRA_CAST<_func_void_void_ptr *>(&LAB_006a7f10));
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x696450)) = 0;
|
|
local_8 = CONCAT31((*GHIDRA_CAST<uint8_t *>((GHIDRA_CAST<char *>(&(local_8)) + 0x1))),10);
|
|
_eh_vector_constructor_iterator_
|
|
((void *)(GHIDRA_INT(this) + 0x696458),0x520,0x40,Entity_Knife::Constructor,FUN_00960bc0);
|
|
*GHIDRA_CAST<uint32_t *>((GHIDRA_CAST<char *>(this) + 0x6aac58)) = 0;
|
|
ExceptionList = local_10;
|
|
return;
|
|
}
|