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
|
|
@ -31,9 +31,8 @@ namespace Server.Network
|
|||
|
||||
public static string FormatTS(TimeSpan ts)
|
||||
{
|
||||
var totalSeconds = (int)ts.TotalSeconds;
|
||||
var seconds = totalSeconds % 60;
|
||||
var minutes = totalSeconds / 60;
|
||||
var totalSeconds = (int)Math.Round(ts.TotalSeconds);
|
||||
var minutes = Math.DivRem(totalSeconds, 60, out var seconds);
|
||||
|
||||
if (minutes != 0 && seconds != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue