diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 533938595..cd502afb6 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -52067,7 +52067,7 @@ glabel func0f04b2f4 ); GLOBAL_ASM( -glabel func0f04b578 +glabel chrSpawn /* f04b578: 27bdff78 */ addiu $sp,$sp,-136 /* f04b57c: afbf0024 */ sw $ra,0x24($sp) /* f04b580: afa5008c */ sw $a1,0x8c($sp) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 85659d364..33c9ea468 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -5742,7 +5742,7 @@ bool aiIfCountdownTimerGreaterThan(void) * @cmd 00c6 */ GLOBAL_ASM( -glabel ai00c6 +glabel aiSpawnChr /* f05565c: 27bdffc8 */ addiu $sp,$sp,-56 /* f055660: afb00020 */ sw $s0,0x20($sp) /* f055664: 3c10800a */ lui $s0,%hi(g_Vars) @@ -5782,7 +5782,7 @@ glabel ai00c6 /* f0556ec: afa20010 */ sw $v0,0x10($sp) /* f0556f0: 97a70032 */ lhu $a3,0x32($sp) /* f0556f4: afa30034 */ sw $v1,0x34($sp) -/* f0556f8: 0fc12d5e */ jal func0f04b578 +/* f0556f8: 0fc12d5e */ jal chrSpawn /* f0556fc: afa80014 */ sw $t0,0x14($sp) /* f055700: 10400007 */ beqz $v0,.L0f055720 /* f055704: 8fa30034 */ lw $v1,0x34($sp) @@ -5804,6 +5804,23 @@ glabel ai00c6 /* f05573c: 00001025 */ or $v0,$zero,$zero ); +//bool aiSpawnChr(void) +//{ +// u8 *cmd = g_Vars.ailist + g_Vars.aioffset; +// u16 pad = cmd[5] | (cmd[4] << 8); +// u32 flags = (cmd[9] << 16) | (cmd[10] << 8) | cmd[11] | (cmd[8] << 24); +// s32 ailistid = cmd[7] | (cmd[6] << 8); +// u8 *ailist = ailistFindById(ailistid & 0xffff); +// +// if (chrSpawn(g_Vars.chrdata, cmd[2], (s8)cmd[3], pad, ailist, flags)) { +// g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[12]); +// } else { +// g_Vars.aioffset += 13; +// } +// +// return false; +//} + /** * @cmd 00c7 */ diff --git a/src/include/game/chr/chr.h b/src/include/game/chr/chr.h index 50bca31fe..b683301a9 100644 --- a/src/include/game/chr/chr.h +++ b/src/include/game/chr/chr.h @@ -385,7 +385,7 @@ u32 func0f04ad08(struct chrdata *chr); u32 func0f04aeb0(void); u32 func0f04af84(void); u32 func0f04b2f4(void); -u32 func0f04b578(void); +u32 chrSpawn(struct chrdata *chr, s32 body, s32 head, u16 pad, u8 *ailist, u32 flags); u32 func0f04b5f4(void); u32 func0f04b658(struct chrdata *chr); u32 func0f04b748(void); diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 5071f048f..3144e31b2 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -200,7 +200,7 @@ /*0x00c3*/ bool aiIfCountdownTimerStopped(void); /*0x00c4*/ bool aiIfCountdownTimerLessThan(void); /*0x00c5*/ bool aiIfCountdownTimerGreaterThan(void); -/*0x00c6*/ bool ai00c6(void); +/*0x00c6*/ bool aiSpawnChr(void); /*0x00c7*/ bool ai00c7(void); /*0x00c8*/ bool ai00c8(void); /*0x00c9*/ bool ai00c9(void); diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index 63b25c05e..cd8f7d304 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14330,7 +14330,7 @@ bool (*g_CommandPointers[])(void) = { /*0x00c3*/ aiIfCountdownTimerStopped, /*0x00c4*/ aiIfCountdownTimerLessThan, /*0x00c5*/ aiIfCountdownTimerGreaterThan, - /*0x00c6*/ ai00c6, + /*0x00c6*/ aiSpawnChr, /*0x00c7*/ ai00c7, /*0x00c8*/ ai00c8, /*0x00c9*/ ai00c9,