chore(content): Cleans up abilities and some spell timers (#427)
- [X] Exposes Index/Count on the timer. - [X] Cleans up abilities - [X] Combines some spell context/info objects with their timers to reduce allocations - [X] Fixes a bug where immolating weapon both finishes effect or stops in the wrong order due to a race condition.
This commit is contained in:
parent
9ef7752beb
commit
178f71c6dc
33 changed files with 469 additions and 677 deletions
|
|
@ -838,10 +838,9 @@ namespace Server.Spells
|
|||
|
||||
public void Add(Mobile m, Timer t)
|
||||
{
|
||||
if (m_Contexts.TryGetValue(m, out var oldTimer))
|
||||
if (m_Contexts.Remove(m, out var oldTimer))
|
||||
{
|
||||
oldTimer.Stop();
|
||||
m_Contexts.Remove(m);
|
||||
}
|
||||
|
||||
m_Contexts.Add(m, t);
|
||||
|
|
@ -850,6 +849,7 @@ namespace Server.Spells
|
|||
public void Remove(Mobile m)
|
||||
{
|
||||
m_Contexts.Remove(m);
|
||||
// TODO: Should we stop the timer?
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue