From 42b4fd3789ea18a53f4beaafaa6eaf590545951e Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 25 Aug 2024 22:01:21 +1000 Subject: [PATCH] Fix some AI command parameters --- src/game/gailists.c | 4 ++-- src/setups/setuppete.c | 4 ++-- src/setups/setuptra.c | 15 ++++++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/game/gailists.c b/src/game/gailists.c index 1d26b0724..62d12b196 100644 --- a/src/game/gailists.c +++ b/src/game/gailists.c @@ -2352,7 +2352,7 @@ u8 func0007_alerted[] = { unset_self_flag_bankx(CHRFLAG1_FLANKED, BANK_1) unset_self_flag_bankx(CHRFLAG1_DODGED, BANK_1) restart_timer - retreat(0x02, 0x01) + retreat(GOPOSFLAG_RUN, 1) cmd012f beginloop(0x4f) @@ -2792,7 +2792,7 @@ u8 func0007_alerted[] = { label(0x16) dprint 'R','U','N','N','I','N','G','\n',0, set_target_chr(CHR_P1P2) - retreat(2, 1) + retreat(GOPOSFLAG_RUN, 1) beginloop(0x6c) if_dangerous_object_nearby(3, /*goto*/ LABEL_FLEE_GRENADE) diff --git a/src/setups/setuppete.c b/src/setups/setuppete.c index 08585039c..20c340001 100644 --- a/src/setups/setuppete.c +++ b/src/setups/setuppete.c @@ -861,7 +861,7 @@ u8 func1026_uplink[] = { u8 func040d_limo[] = { begin_hovercar_path(0x02) - set_vehicle_speed(GOPOSFLAG_WALK, 0) + set_vehicle_speed(0, 0) if_difficulty_lt(DIFF_SA, /*goto*/ 0x03) // SA and PA @@ -923,7 +923,7 @@ u8 func040c_taxi[] = { label(0x03) set_chr_maxdamage(CHR_SELF, 65456) begin_hovercar_path(0x04) - set_vehicle_speed(GOPOSFLAG_WALK, 0) + set_vehicle_speed(0, 0) // All difficulties label(0x04) diff --git a/src/setups/setuptra.c b/src/setups/setuptra.c index 63db1f1bf..c5301e56a 100644 --- a/src/setups/setuptra.c +++ b/src/setups/setuptra.c @@ -1114,6 +1114,8 @@ u8 func0413_jonathan_hangar[] = { beginloop(0x13) if_enemy_distance_lt_and_los(2540, /*goto*/ 0x32) #if VERSION >= VERSION_NTSC_1_0 + // @bug: The distance and pad params are swapped. + // The intention is to check for 30 units from pad 0xdb6 (3510). if_chr_distance_to_pad_lt(CHR_SELF, 3510, PAD_TRA_001E, /*goto*/ 0x06) #endif if_chr_stopped(/*goto*/ 0x06) @@ -1333,6 +1335,8 @@ u8 func0413_jonathan_hangar[] = { run_to_pad(PAD_TRA_0171) beginloop(0x1e) + // @bug: The distance and pad params are swapped. + // The intention is to check for 20 units from pad 0xe6a (3690). if_chr_distance_to_pad_lt(CHR_SELF, 3690, PAD_TRA_0014, /*goto*/ 0x06) if_chr_stopped(/*goto*/ 0x06) endloop(0x1e) @@ -1432,6 +1436,8 @@ u8 func041b_jonathan_after_terminals[] = { beginloop(0x4b) #if VERSION >= VERSION_NTSC_1_0 + // @bug: The distance and pad params are swapped. + // The intention is to check for 20 units from pad 0xdb6 (3510). if_chr_distance_to_pad_lt(CHR_SELF, 3510, PAD_TRA_0014, /*goto*/ 0x06) #endif if_chr_stopped(/*goto*/ 0x06) @@ -2056,13 +2062,12 @@ u8 func040b_elvis_follow[] = { restart_timer beginloop(0x5b) - // @bug: The pad and distance arguments are swapped here, so this is - // actually checking if Elvis is within 3510 units of pad 0x1e. This - // pad is up near the start of Infiltration so this will never pass. + // @bug: The distance and pad params are swapped. + // The intention is to check for 20 units from pad 0xdb6 (3510). #if VERSION >= VERSION_NTSC_1_0 - if_chr_distance_to_pad_lt(CHR_SELF, 3510, 30, /*goto*/ 0x08) + if_chr_distance_to_pad_lt(CHR_SELF, 3510, PAD_TRA_001E, /*goto*/ 0x08) #else - if_chr_distance_to_pad_lt(CHR_SELF, 3510, 20, /*goto*/ 0x08) + if_chr_distance_to_pad_lt(CHR_SELF, 3510, PAD_TRA_0014, /*goto*/ 0x08) #endif if_los_to_target(/*goto*/ 0x06) goto_next(0x5c)