From 3e70d073adbe88fcd1c1b389c80ba620201ce62f Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:28:24 -0700 Subject: [PATCH] fix: Fixes CloseGump returning true when no gump is closed. (#1902) --- Projects/Server/Mobiles/Mobile.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index 0a98f00b4..588ce0cc9 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -8139,18 +8139,20 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro m_NetState.SendCloseGump(gump.TypeID, 0); m_NetState.RemoveGump(gump); gump.OnServerClose(m_NetState); + + return true; } - return true; + return false; } - public bool CloseAllGumps() + public void CloseAllGumps() { var ns = m_NetState; if (ns.CannotSendPackets()) { - return false; + return; } var gumps = new List(ns.Gumps); @@ -8164,10 +8166,10 @@ public partial class Mobile : IHued, IComparable, ISpawnable, IObjectPro gump.OnServerClose(ns); } - return true; + return; } - public bool HasGump() where T : BaseGump => FindGump() != null; + public bool HasGump() where T : BaseGump => m_NetState?.Gumps.Exists(g => g is T) ?? false; public bool SendGump(BaseGump g) {