diff --git a/src/game/game.c b/src/game/game.c index 31bbae4c5..d866cd0fe 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -88067,28 +88067,19 @@ bool aiSetPunchDodgeList(void) /** * @cmd 01c2 */ -GLOBAL_ASM( -glabel ai01c2 -/* f04df1c: 3c06800a */ lui $a2,0x800a -/* f04df20: 24c69fc0 */ addiu $a2,$a2,-24640 -/* f04df24: 8cc30438 */ lw $v1,0x438($a2) -/* f04df28: 8cce0434 */ lw $t6,0x434($a2) -/* f04df2c: 8cc50424 */ lw $a1,0x424($a2) -/* f04df30: 01c31021 */ addu $v0,$t6,$v1 -/* f04df34: 904f0002 */ lbu $t7,0x2($v0) -/* f04df38: 90590003 */ lbu $t9,0x3($v0) -/* f04df3c: 00001025 */ or $v0,$zero,$zero -/* f04df40: 000fc200 */ sll $t8,$t7,0x8 -/* f04df44: 03192025 */ or $a0,$t8,$t9 -/* f04df48: 10a00003 */ beqz $a1,.L0f04df58 -/* f04df4c: 3088ffff */ andi $t0,$a0,0xffff -/* f04df50: a4a80356 */ sh $t0,0x356($a1) -/* f04df54: 8cc30438 */ lw $v1,0x438($a2) -.L0f04df58: -/* f04df58: 24690004 */ addiu $t1,$v1,0x4 -/* f04df5c: 03e00008 */ jr $ra -/* f04df60: acc90438 */ sw $t1,0x438($a2) -); +bool aiSetShootingAtMeList(void) +{ + u8 *cmd = g_Vars.ailist + g_Vars.aioffset; + u16 ailistid = cmd[3] | (cmd[2] << 8); + + if (g_Vars.chrdata) { + g_Vars.chrdata->aishootingatmelist = ailistid; + } + + g_Vars.aioffset += 4; + + return false; +} /** * @cmd 01c3 diff --git a/src/include/commands.h b/src/include/commands.h index 56f36191f..d568acfc9 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -1707,9 +1707,9 @@ mkshort(0x01c1), \ mkshort(ailistid), -#define set_aishootingatmel(value) \ +#define set_aishootingatmelist(ailistid) \ mkshort(0x01c2), \ - mkshort(value), + mkshort(ailistid), #define set_darkroom_function(function) \ mkshort(0x01c3), \ diff --git a/src/include/game.h b/src/include/game.h index 9fd0320f1..7551778c4 100644 --- a/src/include/game.h +++ b/src/include/game.h @@ -413,7 +413,7 @@ /*0x01bf*/ bool ai01bf(void); /*0x01c0*/ bool ai01c0(void); /*0x01c1*/ bool aiSetPunchDodgeList(void); -/*0x01c2*/ bool ai01c2(void); +/*0x01c2*/ bool aiSetShootingAtMeList(void); /*0x01c3*/ bool ai01c3(void); /*0x01c4*/ bool ai01c4(void); /*0x01c5*/ bool ai01c5(void); diff --git a/src/include/types.h b/src/include/types.h index 44d840d89..9c46533d1 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -207,7 +207,7 @@ struct chrdata { /*0x344*/ struct coord LastDropPos; /*0x350*/ u32 unk350; /*0x354*/ u16 aipunchdodgelist; - /*0x356*/ u16 aishootingatmel; + /*0x356*/ u16 aishootingatmelist; /*0x358*/ u16 poisonCounter; /*0x35a*/ u16 aidarkroomlist; /*0x35c*/ u16 aiplayerdeadlist; diff --git a/src/setup.c b/src/setup.c index 45392ec6a..6af3b001b 100644 --- a/src/setup.c +++ b/src/setup.c @@ -14397,7 +14397,7 @@ bool (*command_pointers[])(void) = { /*0x01bf*/ ai01bf, /*0x01c0*/ ai01c0, /*0x01c1*/ aiSetPunchDodgeList, - /*0x01c2*/ ai01c2, + /*0x01c2*/ aiSetShootingAtMeList, /*0x01c3*/ ai01c3, /*0x01c4*/ ai01c4, /*0x01c5*/ ai01c5, @@ -28530,7 +28530,7 @@ u8 func0007_alerted[] = { // is_chr_is_dead_maybe (named wrong) was false label(0x16) set_onshot_function(GFUNC_ALERTED) - set_aishootingatmel(35) + set_aishootingatmelist(GFUNC_DODGE) set_darkroom_function(GFUNC_SEARCH_FOR_PLAYER) dprint 'S','T','A','R','T',' ','L','O','O','P','\n',0, @@ -32540,7 +32540,7 @@ u8 func002b_do_something_and_wait[] = { * Not used. */ u8 func0022_comment_on_player_dead[] = { - set_aishootingatmel(0) + set_aishootingatmelist(GFUNC_IDLE) dprint 'K','I','L','L','\n',0, stop_chr @@ -32579,8 +32579,6 @@ u8 func0022_comment_on_player_dead[] = { /** * Do a sideways dodge, then assign GFUNC_ALERTED. - * - * Not used? */ u8 func0023_dodge[] = { if_chr_dying(CHR_SELF, /*goto*/ 0x16) @@ -32590,7 +32588,7 @@ u8 func0023_dodge[] = { // Dying label(0x16) - set_aishootingatmel(0) + set_aishootingatmelist(GFUNC_IDLE) set_function(CHR_SELF, GFUNC_IDLE) label(0x13)