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
|
|
@ -100,12 +100,11 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
var until = m_Tournament.SignupStart + m_Tournament.SignupPeriod - Core.Now;
|
||||
string text;
|
||||
var secs = (int)until.TotalSeconds;
|
||||
var secs = (int)Math.Round(until.TotalSeconds);
|
||||
|
||||
if (secs > 0)
|
||||
{
|
||||
var mins = secs / 60;
|
||||
secs %= 60;
|
||||
var mins = Math.DivRem(secs, 60, out secs);
|
||||
|
||||
if (mins > 0 && secs > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -797,10 +797,10 @@ public abstract class BaseSpawner : Item, ISpawner
|
|||
return;
|
||||
}
|
||||
|
||||
var minSeconds = (int)m_MinDelay.TotalSeconds;
|
||||
var maxSeconds = (int)m_MaxDelay.TotalSeconds;
|
||||
var min = (long)m_MinDelay.TotalMilliseconds;
|
||||
var max = (long)m_MaxDelay.TotalMilliseconds;
|
||||
|
||||
var delay = TimeSpan.FromSeconds(Utility.RandomMinMax(minSeconds, maxSeconds));
|
||||
var delay = TimeSpan.FromMilliseconds(Utility.RandomMinMax(min, max));
|
||||
DoTimer(delay);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue