[#44] BaseDataWindow: Fix conversion between season precisions
All checks were successful
Test / Run tests (push) Successful in 1m59s
All checks were successful
Test / Run tests (push) Successful in 1m59s
This commit is contained in:
@ -178,12 +178,14 @@ namespace Elwig.Windows {
|
|||||||
CalcMode = s?.CalcMode ?? 0,
|
CalcMode = s?.CalcMode ?? 0,
|
||||||
});
|
});
|
||||||
if (s != null && d.CopyModifiers) {
|
if (s != null && d.CopyModifiers) {
|
||||||
|
int mult = d.Precision > s.Precision ? (int)Math.Pow(10, d.Precision - s.Precision) : 1;
|
||||||
|
int div = d.Precision < s.Precision ? (int)Math.Pow(10, s.Precision - d.Precision) : 1;
|
||||||
ctx.AddRange(s.Modifiers.Select(m => new Modifier {
|
ctx.AddRange(s.Modifiers.Select(m => new Modifier {
|
||||||
Year = year,
|
Year = year,
|
||||||
ModId = m.ModId,
|
ModId = m.ModId,
|
||||||
Ordering = m.Ordering,
|
Ordering = m.Ordering,
|
||||||
Name = m.Name,
|
Name = m.Name,
|
||||||
AbsValue = m.AbsValue,
|
AbsValue = m.AbsValue * mult / div,
|
||||||
RelValue = m.RelValue,
|
RelValue = m.RelValue,
|
||||||
IsStandard = m.IsStandard,
|
IsStandard = m.IsStandard,
|
||||||
IsQuickSelect = m.IsQuickSelect,
|
IsQuickSelect = m.IsQuickSelect,
|
||||||
|
Reference in New Issue
Block a user