Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -52,17 +52,14 @@ namespace Server.Items
public bool IsOwner(Mobile mob)
{
BaseHouse house = BaseHouse.FindHouseAt(this);
return house != null && house.IsOwner(mob);
return BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true;
}
public override void OnDoubleClick(Mobile from)
{
if (IsOwner(from))
{
OnOffGump onOffGump = new OnOffGump(this);
from.SendGump(onOffGump);
from.SendGump(new OnOffGump(this));
}
else
{
@ -104,12 +101,11 @@ namespace Server.Items
m_Chimes = chimes;
AddBackground(0, 0, 300, 150, 0xA28);
AddHtmlLocalized(45, 20, 300, 35, chimes.TurnedOn ? 1011035 : 1011034, false,
false); // [De]Activate this item
AddButton(40, 53, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(80, 55, 65, 35, 1011036, false, false); // OKAY
AddButton(150, 53, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(190, 55, 100, 35, 1011012, false, false); // CANCEL
AddHtmlLocalized(45, 20, 300, 35, chimes.TurnedOn ? 1011035 : 1011034); // [De]Activate this item
AddButton(40, 53, 0xFA5, 0xFA7, 1);
AddHtmlLocalized(80, 55, 65, 35, 1011036); // OKAY
AddButton(150, 53, 0xFA5, 0xFA7, 0);
AddHtmlLocalized(190, 55, 100, 35, 1011012); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -184,4 +180,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}