prevent OOB write for BGM fix in grotto mixed pools

This commit is contained in:
Eric Hoey 2025-06-11 14:11:25 -04:00
commit 5bf31ef8d7

View file

@ -253,7 +253,9 @@ void Entrance_Init(void) {
for (s16 i = 0; i < 4; i++) { for (s16 i = 0; i < 4; i++) {
// Zero out the bit in the field which tells the game to keep playing // Zero out the bit in the field which tells the game to keep playing
// background music for all four scene setups at each index // background music for all four scene setups at each index
gEntranceTable[override + i].field &= ~ENTRANCE_INFO_CONTINUE_BGM_FLAG; if (override + i < ENTRANCE_TABLE_SIZE) {
gEntranceTable[override + i].field &= ~ENTRANCE_INFO_CONTINUE_BGM_FLAG;
}
} }
} }
} }