From 6e7526f6ad869b3cb0e02bff72e5097776f4a88c Mon Sep 17 00:00:00 2001 From: Victor Chelaru Date: Thu, 23 Nov 2023 15:16:07 -0700 Subject: [PATCH] Removed task cancellation exception catching at the sprite level. We want exceptions so they bubble up and stop the logic altogether. --- Engines/FlatRedBallXNA/FlatRedBall/Sprite.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Engines/FlatRedBallXNA/FlatRedBall/Sprite.cs b/Engines/FlatRedBallXNA/FlatRedBall/Sprite.cs index 62fb5fece..d5cbb2182 100644 --- a/Engines/FlatRedBallXNA/FlatRedBall/Sprite.cs +++ b/Engines/FlatRedBallXNA/FlatRedBall/Sprite.cs @@ -1788,11 +1788,12 @@ public async Task PlayAnimationsAsync(params string[] animations) foreach(var animation in animations) { CurrentChainName = animation; - try - { + // This should not try/catch. If it does, then any caller will continue after it's finished, causing additional logic to run after a screen has ended: + //try + //{ await TimeManager.DelaySeconds(CurrentChain.TotalLength); - } - catch (TaskCanceledException) { return; } + //} + //catch (TaskCanceledException) { return; } } }