diff --git a/include/config.h b/include/config.h index 4790cfa1..848112bb 100644 --- a/include/config.h +++ b/include/config.h @@ -123,6 +123,8 @@ // Visual debug enables some collision visuals. Tapping Right on the dpad will cycle between visual hitboxes, visual surfaces, both, and neither. // If puppyprint is enabled, then this can be cycled only while the screen is active. //#define VISUAL_DEBUG +// Number of supported areas per level. +#define AREA_COUNT 8 // BUG/GAME QOL FIXES // Fix instant warp offset not working when warping across different areas diff --git a/src/engine/level_script.c b/src/engine/level_script.c index 97c06e93..e656482e 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -316,7 +316,7 @@ static void level_cmd_init_level(void) { clear_objects(); clear_areas(); main_pool_push_state(); - for (u8 clearPointers; clearPointers < 8; clearPointers++) { + for (u8 clearPointers = 0; clearPointers < AREA_COUNT; clearPointers++) { gAreaSkyboxStart[clearPointers] = 0; gAreaSkyboxEnd[clearPointers] = 0; } diff --git a/src/game/area.c b/src/game/area.c index eb1b829a..ce9fefd3 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -264,7 +264,7 @@ void load_mario_area(void) { } if (gAreaSkyboxStart[gCurrAreaIndex-1]) { load_segment_decompress(0x0A, gAreaSkyboxStart[gCurrAreaIndex-1], gAreaSkyboxEnd[gCurrAreaIndex-1]); - } + } } void unload_mario_area(void) { diff --git a/src/game/game_init.c b/src/game/game_init.c index 450fe395..e081e277 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -86,8 +86,8 @@ u32 gGlobalTimer = 0; #ifdef WIDE s16 gWidescreen; #endif -u8 *gAreaSkyboxStart[7]; -u8 *gAreaSkyboxEnd[7]; +u8 *gAreaSkyboxStart[AREA_COUNT-1]; +u8 *gAreaSkyboxEnd[AREA_COUNT-1]; // Framebuffer rendering values (max 3) u16 sRenderedFramebuffer = 0; diff --git a/src/game/game_init.h b/src/game/game_init.h index 7b1a7588..0d451764 100644 --- a/src/game/game_init.h +++ b/src/game/game_init.h @@ -49,8 +49,8 @@ extern u8 gBorderHeight; #ifdef CUSTOM_DEBUG extern u8 gCustomDebugMode; #endif -extern u8 *gAreaSkyboxStart[7]; -extern u8 *gAreaSkyboxEnd[7]; +extern u8 *gAreaSkyboxStart[AREA_COUNT-1]; +extern u8 *gAreaSkyboxEnd[AREA_COUNT-1]; #ifdef EEP extern s8 gEepromProbe; #endif