fix: Adds more debugging to the timer system. Simplifies the timer pool. (#1195)
This commit is contained in:
parent
d5416b6dec
commit
919b7e9416
6 changed files with 99 additions and 38 deletions
|
|
@ -9,8 +9,7 @@ namespace Server
|
|||
{
|
||||
private TimerExecutionToken _timerToken;
|
||||
|
||||
public BuffInfo(BuffIcon iconID, int titleCliloc)
|
||||
: this(iconID, titleCliloc, titleCliloc + 1)
|
||||
public BuffInfo(BuffIcon iconID, int titleCliloc) : this(iconID, titleCliloc, titleCliloc + 1)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -105,8 +104,6 @@ namespace Server
|
|||
|
||||
public long TimeStart { get; }
|
||||
|
||||
public TimerExecutionToken TimerToken => _timerToken;
|
||||
|
||||
public bool RetainThroughDeath { get; }
|
||||
|
||||
public TextDefinition Args { get; }
|
||||
|
|
@ -139,6 +136,7 @@ namespace Server
|
|||
|
||||
public static void RemoveBuff(Mobile m, BuffInfo b)
|
||||
{
|
||||
b._timerToken.Cancel();
|
||||
(m as PlayerMobile)?.RemoveBuff(b);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4589,13 +4589,11 @@ namespace Server.Mobiles
|
|||
|
||||
public void RemoveBuff(BuffIcon b)
|
||||
{
|
||||
if (m_BuffTable == null || !m_BuffTable.Remove(b, out var info))
|
||||
if (m_BuffTable?.Remove(b) != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
info.TimerToken.Cancel();
|
||||
|
||||
if (NetState?.BuffIcon == true)
|
||||
{
|
||||
BuffInfo.SendRemoveBuffPacket(NetState, Serial, b);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue