From 445c6d879e87fcfbd9fb86ab4ab0b42480ae09d5 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 25 May 2026 12:02:20 +0200 Subject: [PATCH] Don't display Pokemon woke up dialog if it fainted --- Plugins/PkmnLib.Plugin.Gen7/Scripts/Status/Sleep.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Status/Sleep.cs b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Status/Sleep.cs index 36b4e4b..25b59d7 100644 --- a/Plugins/PkmnLib.Plugin.Gen7/Scripts/Status/Sleep.cs +++ b/Plugins/PkmnLib.Plugin.Gen7/Scripts/Status/Sleep.cs @@ -53,10 +53,14 @@ public class Sleep : Script, IScriptChangeNumberOfHits, IAIInfoScriptNumberTurns /// public override void OnRemove() { - _pokemon?.BattleData?.Battle.EventHook.Invoke(new DialogEvent("pokemon_woke_up", new Dictionary + if (_pokemon is { IsFainted: false }) { - { "pokemon", _pokemon }, - })); + _pokemon.BattleData?.Battle.EventHook.Invoke(new DialogEvent("pokemon_woke_up", + new Dictionary + { + { "pokemon", _pokemon }, + })); + } } ///