We don't need any time to remove no shields

Closes #426
This commit is contained in:
felixlinker
2019-05-17 18:51:09 +02:00
parent 0c4fc1fd9a
commit 1f665eed9e

View File

@@ -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 {