Skip to content

Commit

Permalink
Prevent dividing by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Basilisk3 authored May 12, 2024
1 parent 0517cdc commit 1231c97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions www/res/scripts/calculations.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ function calculateDps($stdClassWeapon, $unitID, $Projectile){
/// BTW - SpookyDB uses round(), not floor(), based on the values seen there. Values will not match between DBs. floor() is the correct method.
if(isset($weapon["RateOfFire"])) {
$trueReload = max(0.1*floor(10 / $weapon["RateOfFire"]), 0.1);
} else {
$trueReload = 1;
}
$trueReload = max(
($weapon["RackSalvoChargeTime"] ?? 0) + ($weapon["RackSalvoReloadTime"] ?? 0) +
Expand Down

0 comments on commit 1231c97

Please sign in to comment.