Cleanup that was missed during the last sweep. (#14)

This commit is contained in:
Kamron Batman 2019-03-03 15:10:20 -08:00 • committed by GitHub
parent 5cf37da625
commit 01d0fb75b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 93 additions and 111 deletions

View file

@ -219,29 +219,29 @@ namespace Server.Commands
if (entry != null)
{
if (@from.AccessLevel >= entry.AccessLevel)
if (from.AccessLevel >= entry.AccessLevel)
{
if (entry.Handler != null)
{
CommandEventArgs e = new CommandEventArgs(@from, command, argString, args);
CommandEventArgs e = new CommandEventArgs(from, command, argString, args);
entry.Handler(e);
EventSink.InvokeCommand(e);
}
}
else
{
if (@from.AccessLevel <= BadCommandIgnoreLevel)
if (from.AccessLevel <= BadCommandIgnoreLevel)
return false;
@from.SendMessage("You do not have access to that command.");
from.SendMessage("You do not have access to that command.");
}
}
else
{
if (@from.AccessLevel <= BadCommandIgnoreLevel)
if (from.AccessLevel <= BadCommandIgnoreLevel)
return false;
@from.SendMessage("That is not a valid command.");
from.SendMessage("That is not a valid command.");
}
return true;

View file

@ -1134,10 +1134,8 @@ namespace Server
{
IEntity p = m_Parent;
while (p is Item)
while (p is Item item)
{
Item item = (Item)p;
if (item.m_Parent == null) break;
p = item.m_Parent;
@ -3349,13 +3347,11 @@ namespace Server
{
IEntity p = m_Parent;
while (p is Item)
while (p is Item item)
{
if (p is T)
if (item is T)
return true;
Item item = (Item)p;
if (item.m_Parent == null) break;
p = item.m_Parent;
@ -4024,12 +4020,12 @@ namespace Server
{
object p = this;
while (p is Item)
while (p is Item item)
{
if (p is SecureTradeContainer container)
if (item is SecureTradeContainer container)
return container;
p = ((Item)p).m_Parent;
p = item.m_Parent;
}
return null;
@ -4125,10 +4121,8 @@ namespace Server
if (p == o)
return true;
while (p is Item)
while (p is Item item)
{
Item item = (Item)p;
if (item.m_Parent == null)
break;
@ -4214,22 +4208,22 @@ namespace Server
NetState ns = from.NetState;
if (ns != null)
if (ns == null)
return;
if (Name == null)
{
if (Name == null)
{
if (m_Amount <= 1)
ns.Send(new MessageLocalized(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", ""));
else
ns.Send(new MessageLocalizedAffix(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "",
AffixType.Append,
$" : {m_Amount}", ""));
}
if (m_Amount <= 1)
ns.Send(new MessageLocalized(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", ""));
else
{
ns.Send(new UnicodeMessage(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "",
Name + (m_Amount > 1 ? " : " + m_Amount : "")));
}
ns.Send(new MessageLocalizedAffix(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "",
AffixType.Append,
$" : {m_Amount}", ""));
}
else
{
ns.Send(new UnicodeMessage(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "",
Name + (m_Amount > 1 ? " : " + m_Amount : "")));
}
}

View file

@ -80,10 +80,6 @@ namespace Server
AppendCompilerOption(ref sb, "/d:NEWTIMERS");
#endif
#if NEWPARENT
AppendCompilerOption(ref sb, "/d:NEWPARENT");
#endif
return sb?.ToString();
}