Billing: Fix forced attribute calculation

This commit is contained in:
2023-10-16 22:41:12 +02:00
parent ff2968c989
commit 0b79fa192e

View File

@ -104,7 +104,7 @@ namespace Elwig.Helpers.Billing {
var u = used.GetValueOrDefault(key, 0);
var vr = Math.Max(0, Math.Min(rightsAndObligations[key].Item1 - u, w));
var vo = Math.Max(0, Math.Min(rightsAndObligations[key].Item2 - u, w));
var v = (c == 0 || p.Select(a => attrVals[a]).Min() == 2) ? vr : vo;
var v = (attributes.Length == 0 || attributes.Select(a => attrVals[a]).Min() == 2) ? vr : vo;
used[key] = u + v;
inserts.Add((did, dpnr, i, key[2..], v));
w -= v;