* Make calculateTpKKMod a bit easier to read

This commit is contained in:
Kreuvf
2021-03-28 15:19:30 +02:00
parent cc34f53e39
commit ec4502b7b2
@@ -17191,9 +17191,14 @@ on("change:kk change:NKW1_SchwellenwertKK change:NKW1_Schwellenwert change:NKW2_
});
function calculateTpKKMod(values, weapon) {
let kkDifference = parseInt(values["kk"]) - parseInt(values["NKW" + weapon + "_SchwellenwertKK"]);
let KK = parseInt(values["kk"]);
let weaponKK = parseInt(values["NKW" + weapon + "_SchwellenwertKK"]);
let threshold = parseInt(values["NKW" + weapon + "_Schwellenwert"]);
let kkDifference = KK - weaponKK;
var tpkkMod = Math.floor(Math.abs(kkDifference) / threshold);
var tpkkMod = Math.floor(Math.abs(kkDifference) / parseInt(values["NKW" + weapon + "_Schwellenwert"]));
if (kkDifference < 0) {
tpkkMod = tpkkMod * -1;
}