cleanup: Fixes bugs and cleans up code (#660)
This commit is contained in:
parent
1de0b656a9
commit
679e8100f4
99 changed files with 160 additions and 346 deletions
|
|
@ -54,6 +54,7 @@ namespace Server.Commands
|
|||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ namespace Server.Commands.Generic
|
|||
|
||||
public Type Type { get; }
|
||||
|
||||
public bool IsItem => Type == null || Type.IsAssignableTo(OfItem);
|
||||
public bool IsItem => Type?.IsAssignableTo(OfItem) != false;
|
||||
|
||||
public bool IsMobile => Type == null || Type.IsAssignableTo(OfMobile);
|
||||
public bool IsMobile => Type?.IsAssignableTo(OfMobile) != false;
|
||||
|
||||
public bool HasCompiled => m_Conditionals != null;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Server.Accounting;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Server.Commands
|
|||
|
||||
public CAGCategory Parent { get; set; }
|
||||
|
||||
public override string Title => Type == null ? "bad type" : Type.Name;
|
||||
public override string Title => Type?.Name ?? "bad type";
|
||||
|
||||
public override void OnClick(Mobile from, int page)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Server.Engines.Quests.Haven;
|
||||
|
|
@ -73,7 +72,7 @@ namespace Server.Commands
|
|||
private static readonly Type typeofCannon = typeof(Cannon);
|
||||
private static readonly Type typeofSerpentPillar = typeof(SerpentPillar);
|
||||
|
||||
private static readonly Queue m_DeleteQueue = new();
|
||||
private static readonly Queue<Item> m_DeleteQueue = new();
|
||||
|
||||
private static readonly string[] m_EmptyParams = Array.Empty<string>();
|
||||
private List<DecorationEntryMag> m_Entries;
|
||||
|
|
@ -1143,7 +1142,7 @@ namespace Server.Commands
|
|||
|
||||
while (m_DeleteQueue.Count > 0)
|
||||
{
|
||||
((Item)m_DeleteQueue.Dequeue())?.Delete();
|
||||
m_DeleteQueue.Dequeue()?.Delete();
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue