mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
error handling in case the randomizer picks a pokemon that does not exist
This commit is contained in:
@@ -340,7 +340,11 @@ def pbWildBattle(species, level, outcomeVar=1, canRun=true, canLose=false)
|
||||
dexnum = getDexNumberForSpecies(species)
|
||||
if $game_switches[SWITCH_RANDOM_STATIC_ENCOUNTERS] && dexnum <= NB_POKEMON
|
||||
newSpecies = $PokemonGlobal.psuedoBSTHash[dexnum]
|
||||
species = getSpecies(newSpecies)
|
||||
if !newSpecies
|
||||
displayRandomizerErrorMessage()
|
||||
else
|
||||
species = getSpecies(newSpecies)
|
||||
end
|
||||
end
|
||||
|
||||
# Potentially call a different pbWildBattle-type method instead (for roaming
|
||||
|
||||
Reference in New Issue
Block a user