fix: Fixes CloseGump returning true when no gump is closed. (#1902)

This commit is contained in:
Kamron Batman 2024-08-05 12:28:24 -07:00 committed by GitHub
parent 5d9d1a2118
commit 3e70d073ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8139,18 +8139,20 @@ public partial class Mobile : IHued, IComparable<Mobile>, 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<BaseGump>(ns.Gumps);
@ -8164,10 +8166,10 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
gump.OnServerClose(ns);
}
return true;
return;
}
public bool HasGump<T>() where T : BaseGump => FindGump<T>() != null;
public bool HasGump<T>() where T : BaseGump => m_NetState?.Gumps.Exists(g => g is T) ?? false;
public bool SendGump(BaseGump g)
{