Don't display Pokemon woke up dialog if it fainted

This commit is contained in:
2026-05-25 12:02:20 +02:00
parent 3e12a4a28f
commit 445c6d879e

View File

@@ -53,11 +53,15 @@ public class Sleep : Script, IScriptChangeNumberOfHits, IAIInfoScriptNumberTurns
/// <inheritdoc />
public override void OnRemove()
{
_pokemon?.BattleData?.Battle.EventHook.Invoke(new DialogEvent("pokemon_woke_up", new Dictionary<string, object>
if (_pokemon is { IsFainted: false })
{
_pokemon.BattleData?.Battle.EventHook.Invoke(new DialogEvent("pokemon_woke_up",
new Dictionary<string, object>
{
{ "pokemon", _pokemon },
}));
}
}
/// <inheritdoc />
public int TurnsLeft() => Turns;