Untangled TMs and HMs from item ids (#7173)

This commit is contained in:
Nephrite
2025-07-04 18:07:53 +01:00
committed by GitHub
parent b3f52166df
commit e8abfbce49
21 changed files with 201 additions and 209 deletions

View File

@@ -353,14 +353,12 @@ static u16 GetRandomAlternateMove(u8 monId)
// NOTE: Below is an infinite loop if a species which cannot learn TMs is assigned to an Apprentice
do
{
id = Random() % (NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES);
shouldUseMove = CanLearnTeachableMove(species, ItemIdToBattleMoveId(ITEM_TM01 + id));
id = (Random() % NUM_ALL_MACHINES) + 1;
move = GetTMHMMoveId(id);
shouldUseMove = CanLearnTeachableMove(species, move);
}
while (!shouldUseMove);
move = ItemIdToBattleMoveId(ITEM_TM01 + id);
shouldUseMove = TRUE;
if (numLearnsetMoves <= MAX_MON_MOVES)
j = 0;
else