From 06682ba697201eb25fc8bf446d4cf751b2019514 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 2 Dec 2020 21:14:13 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20crash=20when=20a=20foe=20trainer=20trie?= =?UTF-8?q?s=20to=20replace=20a=20caught=20Shadow=20Pok=C3=A9mon,=20fixed?= =?UTF-8?q?=20Hall=20of=20Fame=20not=20remembering=20entries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/016_Pokemon/002_Pokemon_Forms.rb | 1 + Data/Scripts/017_UI/027_PScreen_HallOfFame.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/Scripts/016_Pokemon/002_Pokemon_Forms.rb b/Data/Scripts/016_Pokemon/002_Pokemon_Forms.rb index cef9e2f25..4bc48a0d9 100644 --- a/Data/Scripts/016_Pokemon/002_Pokemon_Forms.rb +++ b/Data/Scripts/016_Pokemon/002_Pokemon_Forms.rb @@ -61,6 +61,7 @@ class PokeBattle_RealBattlePeer # For switching out, including due to fainting, and for the end of battle def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false) + return if !pkmn f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle) pkmn.form = f if f && pkmn.form!=f pkmn.hp = pkmn.totalhp if pkmn.hp>pkmn.totalhp diff --git a/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb b/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb index de153a00f..0f3e57d33 100644 --- a/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb +++ b/Data/Scripts/017_UI/027_PScreen_HallOfFame.rb @@ -486,7 +486,8 @@ class PokemonGlobalMetadata attr_writer :hallOfFameLastNumber def hallOfFame - return @hallOfFame || [] + @hallOfFame = [] if !@hallOfFame + return @hallOfFame end def hallOfFameLastNumber