Discover aiIfPlayerUsingCmpOrAr34

This commit is contained in:
Ryan Dwyer 2019-11-26 23:10:08 +10:00
parent c981e10bea
commit 8fac472e92
5 changed files with 9 additions and 12 deletions

View File

@ -10307,14 +10307,14 @@ bool ai0125(void)
/**
* @cmd 0126
*/
bool ai0126(void)
bool aiIfPlayerUsingCmpOrAr34(void)
{
u32 arg = 0;
u8 *cmd = g_Vars.ailist + g_Vars.aioffset;
switch (getCurrentPlayerWeaponId(arg)) {
case 10:
case 17:
case WEAPON_CMP150:
case WEAPON_AR34:
g_Vars.aioffset = chraiGoToLabel(g_Vars.ailist, g_Vars.aioffset, cmd[2]);
break;
default:

View File

@ -1185,10 +1185,7 @@
mkshort(0x0125), \
label,
// Looks at the first element in some struct array,
// and checks if field 0x640 is nonzero.
// globals.s only
#define cmd0126_if_something(label) \
#define if_player_using_cmp150_or_ar34(label) \
mkshort(0x0126), \
label,

View File

@ -294,7 +294,7 @@
/*0x0123*/ bool ai0123(void);
/*0x0124*/ bool ai0124(void);
/*0x0125*/ bool ai0125(void);
/*0x0126*/ bool ai0126(void);
/*0x0126*/ bool aiIfPlayerUsingCmpOrAr34(void);
/*0x0127*/ bool ai0127(void);
/*0x0128*/ bool ai0128(void);
/*0x0129*/ bool ai0129(void);

View File

@ -1436,7 +1436,7 @@ u8 func0007_alerted[] = {
if_within_units_of_sight(30, /*goto*/ 0x5f)
label(0x16)
if_within_units_of_sight(30, /*goto*/ 0x16)
cmd0126_if_something(/*goto*/ 0x69)
if_player_using_cmp150_or_ar34(/*goto*/ 0x69)
if_chr_distance_gt(2000, /*goto*/ 0x61)
goto_next(0x16)
@ -1549,7 +1549,7 @@ u8 func0007_alerted[] = {
goto_next(0x16)
label(0x66)
cmd0126_if_something(/*goto*/ 0x69)
if_player_using_cmp150_or_ar34(/*goto*/ 0x69)
if_chr_distance_gt(2000, /*goto*/ 0x16)
goto_next(0x6a)
@ -1572,7 +1572,7 @@ u8 func0007_alerted[] = {
beginloop(0x62)
cmd013d_if_grenade_thrown_nearby_maybe(ACTION_GRENADE_STOP, /*goto*/ LABEL_FLEE_GRENADE)
if_in_disarm_range(/*goto*/ 0x5f)
cmd0126_if_something(/*goto*/ 0x69)
if_player_using_cmp150_or_ar34(/*goto*/ 0x69)
if_chr_distance_gt(2000, /*goto*/ 0x65)
goto_next(0x16)

View File

@ -14426,7 +14426,7 @@ bool (*g_CommandPointers[])(void) = {
/*0x0123*/ ai0123,
/*0x0124*/ ai0124,
/*0x0125*/ ai0125,
/*0x0126*/ ai0126,
/*0x0126*/ aiIfPlayerUsingCmpOrAr34,
/*0x0127*/ ai0127,
/*0x0128*/ ai0128,
/*0x0129*/ ai0129,