Fixes dictionary uses (#7)
This commit is contained in:
parent
d4a52344f2
commit
916d404c51
161 changed files with 1211 additions and 1722 deletions
|
|
@ -16,7 +16,7 @@ namespace Server.Spells.Fourth
|
|||
Reagent.SulfurousAsh
|
||||
);
|
||||
|
||||
private static Dictionary<Mobile, Timer> m_UnderEffect = new Dictionary<Mobile, Timer>();
|
||||
private static HashSet<Mobile> m_UnderEffect = new HashSet<Mobile>();
|
||||
|
||||
public CurseSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ namespace Server.Spells.Fourth
|
|||
|
||||
public static bool UnderEffect(Mobile m)
|
||||
{
|
||||
return m_UnderEffect.ContainsKey(m);
|
||||
return m_UnderEffect.Contains(m);
|
||||
}
|
||||
|
||||
public void Target(Mobile m)
|
||||
|
|
@ -59,13 +59,12 @@ namespace Server.Spells.Fourth
|
|||
SpellHelper.AddStatCurse(Caster, m, StatType.Int);
|
||||
SpellHelper.DisableSkillCheck = false;
|
||||
|
||||
Timer t = m_UnderEffect[m];
|
||||
|
||||
if (Caster.Player && m.Player /*&& Caster != m */ && t == null
|
||||
if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m)
|
||||
) //On OSI you CAN curse yourself and get this effect.
|
||||
{
|
||||
TimeSpan duration = SpellHelper.GetDuration(Caster, m);
|
||||
m_UnderEffect[m] = Timer.DelayCall(duration, RemoveEffect, m);
|
||||
m_UnderEffect.Add(m);
|
||||
Timer.DelayCall(duration, RemoveEffect, m);
|
||||
m.UpdateResistances();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue