fix: Fixes various memory leaks and spells (#1786)
### Summary - Fixes various memory leaks related to spells - Fixes Spell Plague - Added ability to determine if `sdi` should take effect for Spell Damage. - Fixes animal form timer ticking non-stop while logged out.
This commit is contained in:
parent
6747168db0
commit
a552cf4138
51 changed files with 4164 additions and 4188 deletions
|
|
@ -117,24 +117,16 @@ namespace Server.Spells.Fourth
|
|||
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private readonly Mobile m_Owner;
|
||||
private readonly Mobile _owner;
|
||||
|
||||
public InternalTimer(Mobile target, Mobile caster) : base(TimeSpan.FromSeconds(0))
|
||||
{
|
||||
var time = caster.Skills.Magery.Value * 1.2;
|
||||
if (time > 144)
|
||||
{
|
||||
time = 144;
|
||||
}
|
||||
public InternalTimer(Mobile target, Mobile caster) : base(GetDelay(caster)) => _owner = target;
|
||||
|
||||
Delay = TimeSpan.FromSeconds(time);
|
||||
|
||||
m_Owner = target;
|
||||
}
|
||||
private static TimeSpan GetDelay(Mobile caster) =>
|
||||
TimeSpan.FromSeconds(Math.Min(144, caster.Skills.Magery.Value * 1.2));
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
RemoveEntry(m_Owner);
|
||||
RemoveEntry(_owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue