From 6dbf724a98619e48613ce1379e79c4844019a73e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 8 Nov 2019 21:51:55 +1000 Subject: [PATCH] Identify aiIfDistanceFromTargetToPadGreaterThan --- src/game/chr/chraicommands.c | 2 +- src/include/commands.h | 6 ++++++ src/include/game/chr/chraicommands.h | 2 +- src/setup/setup_000000.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 3ff913d0e..6fb668250 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -2439,7 +2439,7 @@ glabel aiIfDistanceFromTargetToPadLessThan * @cmd 005a */ GLOBAL_ASM( -glabel ai005a +glabel aiIfDistanceFromTargetToPadGreaterThan /* f0510fc: 3c03800a */ lui $v1,0x800a /* f051100: 24639fc0 */ addiu $v1,$v1,-24640 /* f051104: 8c6e0434 */ lw $t6,0x434($v1) diff --git a/src/include/commands.h b/src/include/commands.h index 5c30d81c3..aa237b5d3 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -372,6 +372,12 @@ mkshort(pad), \ label, +#define if_distance_from_target_to_pad_gt(distance, pad, label) \ + mkshort(0x005a), \ + mkshort(distance / 10), \ + mkshort(pad), \ + label, + // type 0 = if in // type 1 = if in same room as self // type 2 = if 's camspy in diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index bd1c61594..2e58ea470 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -93,7 +93,7 @@ /*0x0057*/ bool aiIfDistanceToChrGreaterThan(void); /*0x0058*/ bool ai0058(void); /*0x0059*/ bool aiIfDistanceFromTargetToPadLessThan(void); -/*0x005a*/ bool ai005a(void); +/*0x005a*/ bool aiIfDistanceFromTargetToPadGreaterThan(void); /*0x005b*/ bool ai005b(void); /*0x005c*/ bool ai005c(void); /*0x005d*/ bool aiIfChrHasObject(void); diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index 42133d7c2..b33054412 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14043,7 +14043,7 @@ bool (*g_CommandPointers[])(void) = { /*0x0057*/ aiIfDistanceToChrGreaterThan, /*0x0058*/ ai0058, /*0x0059*/ aiIfDistanceFromTargetToPadLessThan, - /*0x005a*/ ai005a, + /*0x005a*/ aiIfDistanceFromTargetToPadGreaterThan, /*0x005b*/ ai005b, /*0x005c*/ ai005c, /*0x005d*/ aiIfChrHasObject,