diff --git a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb index 70473a9b7..8e54f5af4 100644 --- a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb @@ -154,7 +154,9 @@ module GameData end if $game_switches[SWITCH_RANDOM_GYM_PERSIST_TEAMS] && $PokemonGlobal.randomGymTrainersHash != nil if $PokemonGlobal.randomGymTrainersHash[trainerId] != nil && $PokemonGlobal.randomGymTrainersHash[trainerId].length >= $PokemonGlobal.randomTrainersHash[trainerId].length - return getSpecies($PokemonGlobal.randomGymTrainersHash[trainerId][pokemonIndex]) + newSpecies = getSpecies($PokemonGlobal.randomGymTrainersHash[trainerId][pokemonIndex]) + return newSpecies if newSpecies + return species end end new_species = generateRandomGymSpecies(species) diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 6f8490e23..41dbcca8d 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -82,6 +82,7 @@ end # Blacking out animation #=============================================================================== def pbStartOver(gameover=false) + $game_variables[VAR_CURRENT_GYM_TYPE]=-1 if pbInBugContest? pbBugContestStartOver return diff --git a/Data/Scripts/025-Randomizer/randomizer gym leader edit.rb b/Data/Scripts/025-Randomizer/randomizer gym leader edit.rb index 516ebcc62..32a866e06 100644 --- a/Data/Scripts/025-Randomizer/randomizer gym leader edit.rb +++ b/Data/Scripts/025-Randomizer/randomizer gym leader edit.rb @@ -127,7 +127,7 @@ def bstOk(newspecies, oldPokemonSpecies, bst_range = 50) end def gymLeaderOk(newspecies) - return true if $game_variables[152] == -1 #not in a gym + return true if $game_variables[VAR_CURRENT_GYM_TYPE] == -1 #not in a gym leaderType = getLeaderType() if leaderType == nil return true @@ -138,7 +138,7 @@ def gymLeaderOk(newspecies) end def getLeaderType() - currentGym = $game_variables[152] + currentGym = $game_variables[VAR_CURRENT_GYM_TYPE] if currentGym > $game_variables[151].length return nil else diff --git a/Data/Scripts/050_AddOns/GameplayUtils.rb b/Data/Scripts/050_AddOns/GameplayUtils.rb index f33245609..3d0d280c5 100644 --- a/Data/Scripts/050_AddOns/GameplayUtils.rb +++ b/Data/Scripts/050_AddOns/GameplayUtils.rb @@ -209,7 +209,6 @@ def playPokeFluteAnimation end def restoreDefaultCharacterSprite(charset_number=0) - meta = GameData::Metadata.get_player($Trainer.character_ID) $game_player.setDefaultCharName(nil, 0, false) Graphics.update Input.update