Fixes crash when setting the device option twice

This commit is contained in:
infinitefusion
2024-12-22 16:56:31 -05:00
parent a674134c62
commit d2e5dfb8cd

View File

@@ -200,8 +200,9 @@ class PokemonGameOption_Scene < PokemonOption_Scene
"Prevents leveling above the next gym leader's highest leveled Pokemon" "Prevents leveling above the next gym leader's highest leveled Pokemon"
) )
device_option_selected=$PokemonSystem.on_mobile ? 1 : 0
options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")], options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")],
proc { $PokemonSystem.on_mobile }, proc { device_option_selected },
proc { |value| $PokemonSystem.on_mobile = value == 1 }, proc { |value| $PokemonSystem.on_mobile = value == 1 },
["The intended device on which to play the game.", ["The intended device on which to play the game.",
"Disables some options that aren't supported when playing on mobile."] "Disables some options that aren't supported when playing on mobile."]