From de073413371799b98124efc8fa7e60ef5f7a0797 Mon Sep 17 00:00:00 2001 From: FL Date: Sat, 8 Oct 2022 13:51:13 -0300 Subject: [PATCH] Fixed action button crashing roaming debug menu (#192) --- .../020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index 6a16e190a..6182551a3 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -466,6 +466,11 @@ def pbDebugRoamers Graphics.update Input.update 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 && (pkmn[2] <= 0 || $game_switches[pkmn[2]]) && $PokemonGlobal.roamPokemon[cmdwindow.index] != true @@ -494,7 +499,6 @@ def pbDebugRoamers if cmdwindow.index < cmdwindow.roamerCount pbPlayDecisionSE # Toggle through roaming, not roaming, defeated - pkmn = Settings::ROAMING_SPECIES[cmdwindow.index] if pkmn[2] > 0 && !$game_switches[pkmn[2]] # not roaming -> roaming $game_switches[pkmn[2]] = true