Skip to content

Commit

Permalink
Add null case for fire rate
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 authored and Brutus5000 committed Aug 10, 2024
1 parent 9805040 commit 13fb6e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion www/res/scripts/calculations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 13fb6e8

Please sign in to comment.