Damage dealt only shows enabled weapons

This commit is contained in:
Cmdr McDonald
2017-01-25 10:20:28 +00:00
parent e364560ca7
commit ddc968129d
2 changed files with 4 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
* Add 'average' roll for blueprints
* Update spacing for movement summary
* Provide damage dealt statistics for both shields and hull
* Damage dealt panel only shows enabled weapons
#2.2.10
* Fix detailed export of module reinforcement packages

View File

@@ -118,7 +118,7 @@ export default class DamageDealt extends TranslatedComponent {
let weapons = [];
for (let i = 0; i < ship.hardpoints.length; i++) {
if (ship.hardpoints[i].m) {
if (ship.hardpoints[i].m && ship.hardpoints[i].enabled) {
const m = ship.hardpoints[i].m;
if (m.getDamage() && m.grp !== 'po') {
let dropoff = 1;
@@ -162,8 +162,8 @@ export default class DamageDealt extends TranslatedComponent {
}
}
}
totals.effectivenessShields = totals.effectiveDpsShields / totalDps;
totals.effectivenessHull = totals.effectiveDpsHull / totalDps;
totals.effectivenessShields = totalDps == 0 ? 0 : totals.effectiveDpsShields / totalDps;
totals.effectivenessHull = totalDps == 0 ? 0 : totals.effectiveDpsHull / totalDps;
return { weapons, totals };
}