From e95020c59afaf55a62a81b7e3aaa2995bdfe981c Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 13 Dec 2021 22:01:31 -0300 Subject: [PATCH] Fixed form wrapping to the left. --- src/pokemon_debug.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 5090a5db59..01d9c1253f 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1325,7 +1325,15 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) else { if (gFormSpeciesIdTables[data->currentmonId][formId] == gFormSpeciesIdTables[data->currentmonId][0]) - modArrows->currValue = gFormSpeciesIdTables[data->currentmonId][0]; + { + u8 lastForm; + for (lastForm = 0; gFormSpeciesIdTables[data->currentmonId][lastForm] != FORM_SPECIES_END; lastForm++) + { + if (gFormSpeciesIdTables[data->currentmonId][lastForm + 1] == FORM_SPECIES_END) + break; + } + modArrows->currValue = gFormSpeciesIdTables[data->currentmonId][lastForm]; + } else modArrows->currValue = GetFormSpeciesId(data->currentmonId, formId - 1); }