diff --git a/src/files/setup/setuprit.c b/src/files/setup/setuprit.c index 4ebc336d2..2c89c8911 100644 --- a/src/files/setup/setuprit.c +++ b/src/files/setup/setuprit.c @@ -708,7 +708,7 @@ u8 func1006_hijack[] = { endloop(0x04) label(0x06) - cmd01da(0x35) + play_music_continuously(MUSIC_AIRFORCEONE_X) set_chr_maxdamage(0x01, 10) set_chr_maxdamage(0x04, 10) set_chr_maxdamage(0x05, 10) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 035b4849f..3949de2c5 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -13886,8 +13886,8 @@ bool aiShowCutsceneChrs(void) if (show) { for (i = getNumChrs() - 1; i >= 0; i--) { - if (g_ChrsA[i].chrnum >= 0 && g_ChrsA[i].prop && (g_ChrsA[i].hidden2 & 1)) { - g_ChrsA[i].hidden2 &= ~1; + if (g_ChrsA[i].chrnum >= 0 && g_ChrsA[i].prop && (g_ChrsA[i].hidden2 & CHRH2FLAG_0001)) { + g_ChrsA[i].hidden2 &= ~CHRH2FLAG_0001; g_ChrsA[i].chrflags &= ~CHRCFLAG_HIDDEN; } } @@ -13895,7 +13895,7 @@ bool aiShowCutsceneChrs(void) for (i = getNumChrs() - 1; i >= 0; i--) { if (g_ChrsA[i].chrnum >= 0 && g_ChrsA[i].prop && (g_ChrsA[i].chrflags & (CHRCFLAG_UNPLAYABLE | CHRCFLAG_HIDDEN)) == 0) { - g_ChrsA[i].hidden2 |= 1; + g_ChrsA[i].hidden2 |= CHRH2FLAG_0001; g_ChrsA[i].chrflags |= CHRCFLAG_HIDDEN; } } @@ -14092,7 +14092,7 @@ glabel ai01d9 /** * @cmd 01da */ -bool ai01da(void) +bool aiPlayMusicContinuously(void) { u8 *cmd = g_Vars.ailist + g_Vars.aioffset; func0f16deb8(cmd[2]); diff --git a/src/game/data/data_0083d0.c b/src/game/data/data_0083d0.c index 95717828e..4987b91ed 100644 --- a/src/game/data/data_0083d0.c +++ b/src/game/data/data_0083d0.c @@ -6693,7 +6693,7 @@ bool (*g_CommandPointers[])(void) = { /*0x01d7*/ aiIfDistanceToTarget2LessThan, /*0x01d8*/ aiIfDistanceToTarget2GreaterThan, /*0x01d9*/ ai01d9, - /*0x01da*/ ai01da, + /*0x01da*/ aiPlayMusicContinuously, /*0x01db*/ aiChrKill, /*0x01dc*/ aiRemoveWeaponFromInventory, /*0x01dd*/ ai01dd, diff --git a/src/include/commands.h b/src/include/commands.h index a0808e582..8290e3288 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -3747,11 +3747,15 @@ 0x00, \ u2, -// Only called in AF1 with param 0x35. -// Calls some functions and stores the value at 800840c8. -#define cmd01da(u1) \ +/** + * Unsure exactly how this works. I think it replaces the main level theme with + * the one specified. + * + * Track is expected to be a MUSIC constant. + */ +#define play_music_continuously(track) \ mkshort(0x01da), \ - u1, + track, /** * Kills the given chr. diff --git a/src/include/constants.h b/src/include/constants.h index 5d6c11212..16fc4053e 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -324,6 +324,9 @@ #define CHRHFLAG_40000000 0x40000000 // Air Base and AF1 #define CHRHFLAG_PSYCHOSISED 0x80000000 +// chr->hidden2 +#define CHRH2FLAG_0001 0x0001 + // chr->chrflags #define CHRCFLAG_00000001 0x00000001 // Villa takers, Attack Ship Cass and skedar - both set at end of intros #define CHRCFLAG_00000002 0x00000002 // Seems to be set on guards who can spawn clones? diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 09eaf70e8..9b532c0b1 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -437,7 +437,7 @@ /*0x01d7*/ bool aiIfDistanceToTarget2LessThan(void); /*0x01d8*/ bool aiIfDistanceToTarget2GreaterThan(void); /*0x01d9*/ bool ai01d9(void); -/*0x01da*/ bool ai01da(void); +/*0x01da*/ bool aiPlayMusicContinuously(void); /*0x01db*/ bool aiChrKill(void); /*0x01dc*/ bool aiRemoveWeaponFromInventory(void); /*0x01dd*/ bool ai01dd(void);