From 1f665eed9e8c1191025fb66ba97cc984d37e8e03 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Fri, 17 May 2019 18:51:09 +0200 Subject: [PATCH] We don't need any time to remove no shields Closes #426 --- src/app/shipyard/Calculations.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index e1de292b..8159fcac 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -1014,7 +1014,10 @@ export function timeToDrainWep(ship, wep) { */ export function timeToDeplete(amount, dps, eps, capacity, recharge) { const drainPerSecond = eps - recharge; - if (drainPerSecond <= 0) { + // If there is nothing to remove, we're don instantly + if (!amount) { + return 0; + } if (drainPerSecond <= 0) { // Simple result return amount / dps; } else {