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

@ -7,12 +7,7 @@ namespace Server.Items
{
private Item m_Stone;
[Constructible]
public GuildTeleporter() : this(null)
{
}
public GuildTeleporter(Item stone) : base(0x1869)
public GuildTeleporter(Item stone = null) : base(0x1869)
{
Weight = 1.0;
LootType = LootType.Blessed;
@ -69,7 +64,7 @@ namespace Server.Items
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
else if (stone?.Deleted != false || stone.Guild?.Teleporter != this)
{
from.SendLocalizedMessage(501197); // This teleporting object can not determine what guildstone to teleport
}
@ -98,4 +93,4 @@ namespace Server.Items
}
}
}
}
}