fix(timers): Fixes multiple issue with timer wheel (#705)
* Fixed an issue where a timer truncated the link list. * Fixed an issue where a timer stopped and started itself within an OnTick causing it to remove itself from the link list, but still think it's running.
This commit is contained in:
parent
c2f853d8a8
commit
1d916fe2df
4 changed files with 68 additions and 71 deletions
|
|
@ -110,7 +110,11 @@ namespace Server.Engines.Spawners
|
|||
{
|
||||
m_Count = value;
|
||||
|
||||
if (m_Timer != null && (!IsFull && !m_Timer.Running || IsFull && m_Timer.Running))
|
||||
if (IsFull)
|
||||
{
|
||||
m_Timer?.Stop();
|
||||
}
|
||||
else if (m_Timer?.Running != true)
|
||||
{
|
||||
DoTimer();
|
||||
}
|
||||
|
|
@ -372,11 +376,8 @@ namespace Server.Engines.Spawners
|
|||
|
||||
public void Stop()
|
||||
{
|
||||
if (m_Running)
|
||||
{
|
||||
m_Timer?.Stop();
|
||||
m_Running = false;
|
||||
}
|
||||
m_Timer?.Stop();
|
||||
m_Running = false;
|
||||
}
|
||||
|
||||
public void Defrag()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue