From e0885523981048f0f97ec5f1c413e0481f73c189 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 7 Mar 2022 21:17:31 -0300 Subject: [PATCH] Fixed going out of bounds when choosing a move for detailed Give Mon --- src/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug.c b/src/debug.c index ec8c1251ff..255ac335fd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2389,8 +2389,8 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) if(gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > MOVES_COUNT) - gTasks[taskId].data[3] = MOVES_COUNT; + if(gTasks[taskId].data[3] >= MOVES_COUNT) + gTasks[taskId].data[3] = MOVES_COUNT - 1; } if(gMain.newKeys & DPAD_DOWN) { @@ -2574,7 +2574,7 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu //Moves for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] == 0 || moves[i] == 0xFF || moves[i] > MOVES_COUNT) + if (moves[i] == 0 || moves[i] == 0xFF || moves[i] >= MOVES_COUNT) continue; SetMonMoveSlot(&mon, moves[i], i);