Fixed action button crashing roaming debug menu (#192)

This commit is contained in:
FL
2022-10-08 13:51:13 -03:00
committed by GitHub
parent 882f4c96f8
commit de07341337

View File

@@ -466,6 +466,11 @@ def pbDebugRoamers
Graphics.update Graphics.update
Input.update Input.update
pbUpdateSpriteHash(sprites) pbUpdateSpriteHash(sprites)
if cmdwindow.index < cmdwindow.roamerCount
pkmn = Settings::ROAMING_SPECIES[cmdwindow.index]
else
pkmn = nil
end
if Input.trigger?(Input::ACTION) && cmdwindow.index < cmdwindow.roamerCount && if Input.trigger?(Input::ACTION) && cmdwindow.index < cmdwindow.roamerCount &&
(pkmn[2] <= 0 || $game_switches[pkmn[2]]) && (pkmn[2] <= 0 || $game_switches[pkmn[2]]) &&
$PokemonGlobal.roamPokemon[cmdwindow.index] != true $PokemonGlobal.roamPokemon[cmdwindow.index] != true
@@ -494,7 +499,6 @@ def pbDebugRoamers
if cmdwindow.index < cmdwindow.roamerCount if cmdwindow.index < cmdwindow.roamerCount
pbPlayDecisionSE pbPlayDecisionSE
# Toggle through roaming, not roaming, defeated # Toggle through roaming, not roaming, defeated
pkmn = Settings::ROAMING_SPECIES[cmdwindow.index]
if pkmn[2] > 0 && !$game_switches[pkmn[2]] if pkmn[2] > 0 && !$game_switches[pkmn[2]]
# not roaming -> roaming # not roaming -> roaming
$game_switches[pkmn[2]] = true $game_switches[pkmn[2]] = true