fix: Fixes TimeSpan rounding issues (#1610)
### Summary TLDR - .NET Framework rounded TimeSpan (and some DateTime) methods to the nearest millisecond. This was actually _expected_ accidentally for parts of RunUO. We are aiming to fix this and clean up some other bad assumptions. Closes #1604
This commit is contained in:
parent
98727d13b3
commit
331f24cb71
16 changed files with 91 additions and 87 deletions
|
|
@ -4506,7 +4506,23 @@ namespace Server.Mobiles
|
|||
|
||||
if (NetState?.BuffIcon == true)
|
||||
{
|
||||
b.SendAddBuffPacket(NetState, Serial);
|
||||
// Synchronize the buff icon as close to _on the second_ as we can.
|
||||
var msecs = b.TimeLength.Milliseconds;
|
||||
if (msecs >= 8)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(msecs), (buffInfo, pm) =>
|
||||
{
|
||||
// They are still online, we still have the buff icon in the table, and it is the same buff icon
|
||||
if (pm.NetState != null && pm.m_BuffTable.TryGetValue(buffInfo.ID, out var checkBuff) && checkBuff == buffInfo)
|
||||
{
|
||||
buffInfo.SendAddBuffPacket(pm.NetState, pm.Serial);
|
||||
}
|
||||
}, b, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
b.SendAddBuffPacket(NetState, Serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue