fix: Bufficon timer is not cancelled when refreshed with another one. (#2080)
This commit is contained in:
parent
b4b7182ce6
commit
f5e944335b
2 changed files with 12 additions and 21 deletions
|
|
@ -127,8 +127,13 @@ namespace Server
|
|||
|
||||
public static void RemoveBuff(Mobile m, BuffInfo b)
|
||||
{
|
||||
if (b == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
b._timerToken.Cancel();
|
||||
(m as PlayerMobile)?.RemoveBuff(b);
|
||||
(m as PlayerMobile)?.RemoveBuff(b.ID);
|
||||
}
|
||||
|
||||
public static void RemoveBuff(Mobile m, BuffIcon b)
|
||||
|
|
|
|||
|
|
@ -1591,10 +1591,8 @@ namespace Server.Mobiles
|
|||
{
|
||||
base.OnHiddenChanged();
|
||||
|
||||
RemoveBuff(
|
||||
BuffIcon
|
||||
.Invisibility
|
||||
); // Always remove, default to the hiding icon EXCEPT in the invis spell where it's explicitly set
|
||||
// Always remove, default to the hiding icon EXCEPT in the invis spell where it's explicitly set
|
||||
RemoveBuff(BuffIcon.Invisibility);
|
||||
|
||||
if (!Hidden)
|
||||
{
|
||||
|
|
@ -1602,10 +1600,8 @@ namespace Server.Mobiles
|
|||
}
|
||||
else // if (!InvisibilitySpell.HasTimer( this ))
|
||||
{
|
||||
BuffInfo.AddBuff(
|
||||
this,
|
||||
new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655)
|
||||
); // Hidden/Stealthing & You Are Hidden
|
||||
// Hidden/Stealthing & You Are Hidden
|
||||
BuffInfo.AddBuff(this, new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2654,7 +2650,7 @@ namespace Server.Mobiles
|
|||
|
||||
while (queue.Count > 0)
|
||||
{
|
||||
RemoveBuff(queue.Dequeue());
|
||||
BuffInfo.RemoveBuff(this, queue.Dequeue());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4532,7 +4528,7 @@ namespace Server.Mobiles
|
|||
return;
|
||||
}
|
||||
|
||||
RemoveBuff(b); // Check & subsequently remove the old one.
|
||||
BuffInfo.RemoveBuff(this, b); // Check, stop old timer, & subsequently remove the old one.
|
||||
|
||||
m_BuffTable ??= new Dictionary<BuffIcon, BuffInfo>();
|
||||
m_BuffTable.Add(b.ID, b);
|
||||
|
|
@ -4540,16 +4536,6 @@ namespace Server.Mobiles
|
|||
SendAddBuffPacket(b);
|
||||
}
|
||||
|
||||
public void RemoveBuff(BuffInfo b)
|
||||
{
|
||||
if (b == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RemoveBuff(b.ID);
|
||||
}
|
||||
|
||||
public void RemoveBuff(BuffIcon b)
|
||||
{
|
||||
if (m_BuffTable?.Remove(b) != true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue