Some cleanup of contains keys and try get values (#246)

This commit is contained in:
Kamron Batman 2020-09-13 20:20:44 -07:00 • committed by GitHub
parent 9cbb0cfd23
commit a236617ad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 3508 additions and 350 deletions

View file

@ -95,7 +95,9 @@ namespace Server.Spells.Mysticism
var mount = Caster.Mount;
if (mount != null)
{
mount.Rider = null;
}
Caster.BodyMod = 0x2C1;
Caster.HueMod = 0;
@ -112,7 +114,9 @@ namespace Server.Spells.Mysticism
};
for (var i = 0; i < mods.Length; ++i)
{
Caster.AddResistanceMod(mods[i]);
}
m_Table[Caster] = mods;
@ -141,17 +145,19 @@ namespace Server.Spells.Mysticism
public static void RemoveEffects(Mobile m)
{
if (!m_Table.TryGetValue(m, out var mods))
if (!m_Table.Remove(m, out var mods))
{
return;
}
for (var i = 0; i < mods.Length; ++i)
{
m.RemoveResistanceMod(mods[i]);
}
m.BodyMod = 0;
m.HueMod = -1;
m_Table.Remove(m);
BuffInfo.RemoveBuff(m, BuffIcon.StoneForm);
}