From 13fb6e85be4ec459f807b09f1e5b5e5f00b72a37 Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:13:33 -0700 Subject: [PATCH] Add null case for fire rate --- www/res/scripts/calculations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/res/scripts/calculations.php b/www/res/scripts/calculations.php index 73f3a44..ffea121 100644 --- a/www/res/scripts/calculations.php +++ b/www/res/scripts/calculations.php @@ -69,7 +69,7 @@ function calculateDps($stdClassWeapon, $unitID, $Projectile){ // but thats pretty much a bug so not taken into account here /// BTW - SpookyDB uses round(), not floor(), based on the values seen there. Values will not match between DBs. floor() is the correct method. - $trueReload = max(0.1*floor(10 / $weapon["RateOfFire"]), 0.1); + $trueReload = max(0.1*floor(10 / ($weapon["RateOfFire"] ?? 1)), 0.1); $trueReload = max( ($weapon["RackSalvoChargeTime"] ?? 0) + ($weapon["RackSalvoReloadTime"] ?? 0) + ($weapon["MuzzleSalvoDelay"] ?? 0)*(($weapon["MuzzleSalvoSize"] ?? 1)-1),