Fixes dictionary uses (#7)

This commit is contained in:
Kamron Batman 2018-11-02 08:16:42 -07:00 committed by GitHub
parent d4a52344f2
commit 916d404c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1211 additions and 1722 deletions

View file

@ -164,8 +164,7 @@ namespace Server.Spells.Seventh
public static void StopTimer(Mobile m)
{
InternalTimer timer = m_Timers[m];
if (timer == null)
if (!m_Timers.TryGetValue(m, out InternalTimer timer))
return;
timer.Stop();
@ -174,15 +173,15 @@ namespace Server.Spells.Seventh
private static void EndPolymorph(Mobile m)
{
if (!m.CanBeginAction<PolymorphSpell>())
{
m.BodyMod = 0;
m.HueMod = -1;
m.EndAction<PolymorphSpell>();
if (m.CanBeginAction<PolymorphSpell>())
return;
BaseArmor.ValidateMobile(m);
BaseClothing.ValidateMobile(m);
}
m.BodyMod = 0;
m.HueMod = -1;
m.EndAction<PolymorphSpell>();
BaseArmor.ValidateMobile(m);
BaseClothing.ValidateMobile(m);
}
private class InternalTimer : Timer