Some cleanup of contains keys and try get values (#246)
This commit is contained in:
parent
9cbb0cfd23
commit
a236617ad9
69 changed files with 3508 additions and 350 deletions
|
|
@ -57,7 +57,9 @@ namespace Server.Spells.Necromancy
|
|||
var mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);
|
||||
|
||||
if (m.Skills.MagicResist.Base > 50.0)
|
||||
{
|
||||
m.AddSkillMod(mod);
|
||||
}
|
||||
|
||||
m_Table[m] = mod;
|
||||
}
|
||||
|
|
@ -81,10 +83,11 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
public static bool TryEndEffect(Mobile m)
|
||||
{
|
||||
if (!m_Table.TryGetValue(m, out var mod))
|
||||
if (!m_Table.Remove(m, out var mod))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_Table.Remove(m);
|
||||
mod?.Remove();
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue