Attempt to decompile chrSawDeath

This commit is contained in:
Ryan Dwyer 2019-12-22 14:27:19 +10:00
parent 4a9f344ac2
commit fe93b66f37
3 changed files with 24 additions and 3 deletions

View File

@ -50270,7 +50270,7 @@ glabel func0f04a110
);
GLOBAL_ASM(
glabel func0f04a1ac
glabel chrSawDeath
/* f04a1ac: 27bdffe0 */ addiu $sp,$sp,-32
/* f04a1b0: afbf0014 */ sw $ra,0x14($sp)
/* f04a1b4: afa50024 */ sw $a1,0x24($sp)
@ -50318,6 +50318,27 @@ glabel func0f04a1ac
/* f04a24c: 00000000 */ sll $zero,$zero,0x0
);
// Mismatch because it uses the wrong register for chr->chrseedie
//bool chrSawDeath(struct chrdata *chr, u8 arg1)
//{
// bool saw_death = chr->chrseedie >= 0;
//
// if (!saw_death || arg1) {
// if (saw_death && arg1 == 1) {
// struct chrdata *victim = chrFindById(chr, chr->chrseedie);
//
// if (victim && !func0f04aa8c(chr, victim, 1)) {
// saw_death = false;
// chr->chrseedie = -1;
// }
// } else {
// chr->chrseedie = -1;
// }
// }
//
// return saw_death;
//}
void decrementByte(u8 *dst, u8 amount)
{
if (*dst < amount) {

View File

@ -1646,7 +1646,7 @@ bool aiIfSawDeath(void)
{
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
if (func0f04a1ac(g_Vars.chrdata, cmd[2])) {
if (chrSawDeath(g_Vars.chrdata, cmd[2])) {
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[3]);
} else {
g_Vars.aioffset += 4;

View File

@ -368,7 +368,7 @@ u32 func0f04a0e4(struct chrdata *chr);
s32 chrGetNumArghs(struct chrdata *chr);
s32 chrGetNumCloseArghs(struct chrdata *chr);
u32 func0f04a110(struct chrdata *chr, u32 arg1);
u32 func0f04a1ac(struct chrdata *chr, u32 arg1);
bool chrSawDeath(struct chrdata *chr, u8 arg1);
bool func0f04a2b4(struct chrdata *chr);
u32 func0f04a2d4(void);
u32 func0f04a37c(void);