Fixes givemon moves not defaulting to none (#4377)
This commit is contained in:
parent
5d9f78bcb5
commit
ee3a577240
2 changed files with 21 additions and 3 deletions
|
@ -347,7 +347,9 @@ u32 ScriptGiveMonParameterized(u16 species, u8 level, u16 item, u8 ball, u8 natu
|
|||
// moves
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (moves[i] == MOVE_NONE || moves[i] >= MOVES_COUNT)
|
||||
if (moves[0] == MOVE_NONE)
|
||||
break;
|
||||
if (moves[i] >= MOVES_COUNT)
|
||||
continue;
|
||||
SetMonMoveSlot(&mon, moves[i], i);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,22 @@ TEST("givemon [simple]")
|
|||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100);
|
||||
}
|
||||
|
||||
TEST("givemon [moves]")
|
||||
{
|
||||
ZeroPlayerPartyMons();
|
||||
|
||||
RUN_OVERWORLD_SCRIPT(
|
||||
givemon SPECIES_WOBBUFFET, 100, move1=MOVE_TACKLE, move2=MOVE_SPLASH, move3=MOVE_NONE, move4=MOVE_NONE;
|
||||
);
|
||||
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_SPECIES), SPECIES_WOBBUFFET);
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_LEVEL), 100);
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_MOVE1), MOVE_TACKLE);
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_MOVE2), MOVE_SPLASH);
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_MOVE3), MOVE_NONE);
|
||||
EXPECT_EQ(GetMonData(&gPlayerParty[0], MON_DATA_MOVE4), MOVE_NONE);
|
||||
}
|
||||
|
||||
TEST("givemon [all]")
|
||||
{
|
||||
ZeroPlayerPartyMons();
|
||||
|
|
Loading…
Reference in a new issue