Fixed crash when using upgradeRibbon, fixed crash when trading Pokémon, fixed crash when trying to play Triple Triad, fixed crash when generating Battle Frontier data

This commit is contained in:
Maruno17
2021-12-11 13:25:23 +00:00
parent b9d69b780b
commit 241851a75b
4 changed files with 16 additions and 17 deletions

View File

@@ -132,10 +132,10 @@ def isBattlePokemonDuplicate(pk, pk2)
moves1.push((pk.moves[i]) ? pk.moves[i].id : nil)
moves2.push((pk2.moves[i]) ? pk2.moves[i].id : nil)
end
moves1.sort!
moves2.sort!
moves1.compact.sort
moves2.compact.sort
# Accept as same if moves are same and there are MAX_MOVES number of moves each
return true if moves1 == moves2 && moves1[Pokemon::MAX_MOVES - 1]
return true if moves1 == moves2 && moves1.length == Pokemon::MAX_MOVES
same_evs = true
GameData::Stat.each_main { |s| same_evs = false if pk.ev[s.id] != pk2.ev[s.id] }
return pk.item_id == pk2.item_id && pk.nature_id == pk2.nature_id && same_evs