Fix Debug Give Pokémon (Complex) with duplicate moves (#7821)

This commit is contained in:
Eduardo Quezada
2025-09-29 18:05:13 -03:00
committed by GitHub
parent dc6178d07a
commit 2c80b9124b
2 changed files with 5 additions and 1 deletions

View File

@@ -2853,6 +2853,10 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu
//Moves
for (i = 0; i < MAX_MON_MOVES; i++)
{
// Non-default moveset chosen. Reset moves before setting the chosen moves.
if (moves[0] != MOVE_NONE)
SetMonMoveSlot(&mon, MOVE_NONE, i);
if (moves[i] == MOVE_NONE || moves[i] >= MOVES_COUNT)
continue;

View File

@@ -288,7 +288,7 @@ TEST("givemon [moves]")
ZeroPlayerPartyMons();
RUN_OVERWORLD_SCRIPT(
givemon SPECIES_WOBBUFFET, 100, move1=MOVE_SCRATCH, move2=MOVE_SPLASH, move3=MOVE_NONE, move4=MOVE_NONE;
givemon SPECIES_WOBBUFFET, 100, move1=MOVE_SCRATCH, move2=MOVE_SPLASH, move3=MOVE_NONE;
);
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET);