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
|
|
@ -509,7 +509,7 @@ namespace Server.Spells
|
|||
|
||||
if (scaleDuration)
|
||||
{
|
||||
duration = TimeSpan.FromSeconds(duration.TotalSeconds * scale);
|
||||
duration *= scale;
|
||||
}
|
||||
|
||||
if (scaleStats)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace Server.Items
|
|||
{
|
||||
to.SendLocalizedMessage(
|
||||
1072516, // ~1_name~ will expire in ~2_val~ seconds!
|
||||
$"{Name ?? $"#{LabelNumber}"}\t{(int)LifeSpan.TotalSeconds}"
|
||||
$"{Name ?? $"#{LabelNumber}"}\t{LifeSpan.TotalSeconds:F0}"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ namespace Server.Items
|
|||
|
||||
var remaining = CreationTime + LifeSpan - Core.Now;
|
||||
|
||||
list.Add(1072517, $"{(int)remaining.TotalSeconds}"); // Lifespan: ~1_val~ seconds
|
||||
list.Add(1072517, $"{remaining.TotalSeconds:F0}"); // Lifespan: ~1_val~ seconds
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue