Don't crash and burn if vqa files aren't found

This commit is contained in:
Scott_NZ
2012-08-25 00:33:49 +12:00
committed by Chris Forbes
parent f8e73afbee
commit 362dc8128e

View File

@@ -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<VqaPlayerWidget>("PLAYER");
try
{
player.Load(movie);
}
catch (FileNotFoundException)
{
Ui.CloseWindow();
onComplete();
return;
}
w.EnableTick = false;
player.Load(movie);
// Mute world sounds
var oldModifier = Sound.SoundVolumeModifier;