diff --git a/OpenRA.Game/Sound.cs b/OpenRA.Game/Sound.cs index 5389530144..bcba1295c3 100644 --- a/OpenRA.Game/Sound.cs +++ b/OpenRA.Game/Sound.cs @@ -78,6 +78,9 @@ namespace OpenRA { if (name == "" || name == null) return; + + if (music != null) + soundEngine.StopSound(music); var sound = sounds[name]; music = soundEngine.Play2D(sound, true); diff --git a/OpenRA.Game/Widgets/Delegates/ConnectionDialogsDelegate.cs b/OpenRA.Game/Widgets/Delegates/ConnectionDialogsDelegate.cs index fbb9dabc56..c52978c096 100644 --- a/OpenRA.Game/Widgets/Delegates/ConnectionDialogsDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/ConnectionDialogsDelegate.cs @@ -26,11 +26,11 @@ namespace OpenRA.Widgets.Delegates { var r = Chrome.rootWidget; r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => { - r.CloseWindow(); + Game.Disconnect(); return true; }; r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => { - r.CloseWindow(); + Game.Disconnect(); return true; }; r.GetWidget("CONNECTION_BUTTON_RETRY").OnMouseUp = mi => { diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 0300ecc7d9..0bd4c9c935 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -209,7 +209,8 @@ namespace OpenRA.Widgets public void CloseWindow() { Chrome.rootWidget.GetWidget(WindowList.Pop()).Visible = false; - Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true; + if (WindowList.Count > 0) + Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = true; } public Widget OpenWindow(string id)