Fix a crash when encountering 0 byte .vqa placeholders.

This commit is contained in:
Matthias Mailänder
2022-04-24 13:11:40 +02:00
committed by abcdefg30
parent 9e34299085
commit 91fbd618ce
5 changed files with 33 additions and 10 deletions

View File

@@ -343,15 +343,28 @@ namespace OpenRA.Mods.Common.Widgets.Logic
playingVideo = pv;
player.Load(video);
// video playback runs asynchronously
player.PlayThen(() =>
if (player.Video == null)
{
StopVideo(player);
onComplete?.Invoke();
});
// Mute other distracting sounds
MuteSounds();
ConfirmationDialogs.ButtonPrompt(
title: "Unable to play video",
text: "Something went wrong during video playback.",
cancelText: "Back",
onCancel: () => { });
}
else
{
// video playback runs asynchronously
player.PlayThen(() =>
{
StopVideo(player);
onComplete?.Invoke();
});
// Mute other distracting sounds
MuteSounds();
}
}
}