Fixes dictionary uses (#7)
This commit is contained in:
parent
d4a52344f2
commit
916d404c51
161 changed files with 1211 additions and 1722 deletions
|
|
@ -70,10 +70,7 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
public static int GetImmolatingDamage(BaseWeapon weapon)
|
||||
{
|
||||
if (m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry))
|
||||
return entry.m_Damage;
|
||||
|
||||
return 0;
|
||||
return m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry) ? entry.m_Damage : 0;
|
||||
}
|
||||
|
||||
public static void DoEffect(BaseWeapon weapon, Mobile target)
|
||||
|
|
@ -89,16 +86,14 @@ namespace Server.Spells.Spellweaving
|
|||
|
||||
public static void StopImmolating(BaseWeapon weapon)
|
||||
{
|
||||
if (m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry))
|
||||
{
|
||||
entry.m_Caster?.PlaySound(0x27);
|
||||
if (!m_WeaponDamageTable.TryGetValue(weapon, out ImmolatingWeaponEntry entry))
|
||||
return;
|
||||
|
||||
entry.m_Timer.Stop();
|
||||
entry.m_Caster?.PlaySound(0x27);
|
||||
entry.m_Timer.Stop();
|
||||
m_WeaponDamageTable.Remove(weapon);
|
||||
|
||||
m_WeaponDamageTable.Remove(weapon);
|
||||
|
||||
weapon.InvalidateProperties();
|
||||
}
|
||||
weapon.InvalidateProperties();
|
||||
}
|
||||
|
||||
private class ImmolatingWeaponEntry
|
||||
|
|
@ -127,4 +122,4 @@ namespace Server.Spells.Spellweaving
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue