From 4f95948de5858df7d099c6930732951e9820aaa7 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Sun, 21 Apr 2024 15:54:51 -0300 Subject: [PATCH] Fix level select --- src/mods/levelselect.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mods/levelselect.c b/src/mods/levelselect.c index 5c5f8da6..d09d5170 100644 --- a/src/mods/levelselect.c +++ b/src/mods/levelselect.c @@ -12,27 +12,28 @@ void Map_801A914C(void); void Map_801A6628(void); void Map_LevelSelect(void) { + static planetIndex = 0; static char* sLevelSelectPlanetNames[] = { "METEO", "AREA 6", "BOLSE", "SECTOR Z", "SECTOR X", "SECTOR Y", "KATINA", "MACBETH", "ZONESS", "CORNERIA", "TITANIA", "AQUAS", "FORTUNA", "VENOM", "SOLAR", }; if (gControllerPress[0].button & L_JPAD) { - gCurrentPlanet--; - if (gCurrentPlanet < 0) { - gCurrentPlanet = 14; + planetIndex--; + if (planetIndex < 0) { + planetIndex = 14; } - sCurrentPlanetId = sPlanetList[gCurrentPlanet]; + sCurrentPlanetId = sPlanetList[planetIndex]; Map_801A6368(); Map_801A914C(); } if (gControllerPress[0].button & R_JPAD) { - gCurrentPlanet++; - if (gCurrentPlanet > 14) { - gCurrentPlanet = 0; + planetIndex++; + if (planetIndex > 14) { + planetIndex = 0; } - sCurrentPlanetId = sPlanetList[gCurrentPlanet]; + sCurrentPlanetId = sPlanetList[planetIndex]; Map_801A6368(); Map_801A914C(); }