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

@ -39,12 +39,12 @@ namespace Server.Engines.Quests.Doom
public virtual void BeginSummon(Mobile from)
{
if (Chyloth != null && !Chyloth.Deleted)
if (Chyloth?.Deleted == false)
{
from.SendLocalizedMessage(
1050010); // The ferry man has already been summoned. There is no need to ring for him again.
}
else if (Dragon != null && !Dragon.Deleted)
else if (Dragon?.Deleted == false)
{
from.SendLocalizedMessage(
1050017); // The ferryman has recently been summoned already. You decide against ringing the bell again so soon.
@ -83,9 +83,8 @@ namespace Server.Engines.Quests.Doom
2023, 0);
Effects.PlaySound(loc, Map, 0x1FE);
Chyloth = new Chyloth();
Chyloth = new Chyloth { Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo(loc))) };
Chyloth.Direction = (Direction)(7 & (4 + (int)from.GetDirectionTo(loc)));
Chyloth.MoveToWorld(loc, Map);
Chyloth.Bell = this;
@ -117,4 +116,4 @@ namespace Server.Engines.Quests.Doom
Chyloth?.Delete();
}
}
}
}

View file

@ -254,16 +254,14 @@ namespace Server.Engines.Quests.Doom
AddImageTiled(15, 15, 365, 190, 2624);
AddRadio(30, 140, 9727, 9730, true, 1);
AddHtmlLocalized(65, 145, 300, 25, 1050050, 0x7FFF, false, false); // Yes, let's go!
AddHtmlLocalized(65, 145, 300, 25, 1050050, 0x7FFF); // Yes, let's go!
AddRadio(30, 175, 9727, 9730, false, 0);
AddHtmlLocalized(65, 178, 300, 25, 1050049, 0x7FFF, false, false); // No thanks, I'd rather stay here.
AddHtmlLocalized(65, 178, 300, 25, 1050049, 0x7FFF); // No thanks, I'd rather stay here.
AddHtmlLocalized(30, 20, 360, 35, 1050047, 0x7FFF, false,
false); // Another player has paid Chyloth for your passage across lake Mortis:
AddHtmlLocalized(30, 20, 360, 35, 1050047, 0x7FFF); // Another player has paid Chyloth for your passage across lake Mortis:
AddHtmlLocalized(30, 105, 345, 40, 1050048, 0x5B2D, false,
false); // Do you wish to accept their invitation at this time?
AddHtmlLocalized(30, 105, 345, 40, 1050048, 0x5B2D); // Do you wish to accept their invitation at this time?
AddImage(65, 72, 5605);
@ -272,7 +270,7 @@ namespace Server.Engines.Quests.Doom
AddLabel(90, 70, 1645, leader.Name);
AddButton(290, 175, 247, 248, 2, GumpButtonType.Reply, 0);
AddButton(290, 175, 247, 248, 2);
AddImageTiled(15, 14, 365, 1, 9107);
AddImageTiled(380, 14, 1, 190, 9105);
@ -308,4 +306,4 @@ namespace Server.Engines.Quests.Doom
}
}
}
}
}

View file

@ -28,7 +28,7 @@ namespace Server.Engines.Quests.Doom
{
get
{
if (m_Altar == null || m_Altar.Deleted || m_Altar.Map != Map ||
if (m_Altar?.Deleted != false || m_Altar.Map != Map ||
!Utility.InRange(m_Altar.Location, Location, AltarRange))
foreach (Item item in GetItemsInRange(AltarRange))
if (item is SummoningAltar altar)
@ -143,4 +143,4 @@ namespace Server.Engines.Quests.Doom
int version = reader.ReadInt();
}
}
}
}

View file

@ -77,7 +77,7 @@ namespace Server.Engines.Quests.Doom
QuestObjective obj = FindObjective<CollectBonesObjective>();
if (obj != null && obj.CurProgress > 0)
if (obj?.CurProgress > 0)
{
From.BankBox.DropItem(new DaemonBone(obj.CurProgress));
@ -109,4 +109,4 @@ namespace Server.Engines.Quests.Doom
writer.Write(WaitForSummon);
}
}
}
}