From 362dc8128e58c616bcb5a357299471af4d5273a0 Mon Sep 17 00:00:00 2001 From: Scott_NZ Date: Sat, 25 Aug 2012 00:33:49 +1200 Subject: [PATCH] Don't crash and burn if vqa files aren't found --- OpenRA.Mods.RA/Scripting/Media.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Scripting/Media.cs b/OpenRA.Mods.RA/Scripting/Media.cs index d403d9c945..0edf362863 100644 --- a/OpenRA.Mods.RA/Scripting/Media.cs +++ b/OpenRA.Mods.RA/Scripting/Media.cs @@ -9,6 +9,7 @@ #endregion using System; +using System.IO; using OpenRA.Widgets; namespace OpenRA.Scripting @@ -19,8 +20,19 @@ namespace OpenRA.Scripting { var playerRoot = Game.OpenWindow(w, "FMVPLAYER"); var player = playerRoot.Get("PLAYER"); + + try + { + player.Load(movie); + } + catch (FileNotFoundException) + { + Ui.CloseWindow(); + onComplete(); + return; + } + w.EnableTick = false; - player.Load(movie); // Mute world sounds var oldModifier = Sound.SoundVolumeModifier;