diff --git a/src/app/components/Header.jsx b/src/app/components/Header.jsx index dd309546..db2294d5 100644 --- a/src/app/components/Header.jsx +++ b/src/app/components/Header.jsx @@ -27,7 +27,7 @@ function normalizePercent(val) { if (val === '' || isNaN(val)) { return 0; } - val = Math.round(val * 100) / 100; + val = Math.round(val * 1000) / 1000; return val >= 100 ? 100 : val; } @@ -512,4 +512,4 @@ export default class Header extends TranslatedComponent { ); } -} \ No newline at end of file +} diff --git a/src/app/shipyard/Serializer.js b/src/app/shipyard/Serializer.js index 2608b4ea..1fb3e477 100644 --- a/src/app/shipyard/Serializer.js +++ b/src/app/shipyard/Serializer.js @@ -115,6 +115,11 @@ export function toDetailedBuild(buildName, ship) { return data; }; +/** + * Instantiates a ship from a ship-loadout object, using the code + * @param {Object} detailedBuild ship-loadout object + * @return {Ship} Ship instance + */ export function fromDetailedBuild(detailedBuild) { let shipId = Object.keys(Ships).find((shipId) => Ships[shipId].properties.name.toLowerCase() == detailedBuild.ship.toLowerCase()); diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 7aed5db8..25e35110 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -4,7 +4,7 @@ import Module from './Module'; import LZString from 'lz-string'; import isEqual from 'lodash/lang'; import { Modifications } from 'coriolis-data/dist'; -var zlib = require('zlib'); +const zlib = require('zlib'); const UNIQUE_MODULES = ['psg', 'sg', 'bsg', 'rf', 'fs', 'fh']; @@ -234,7 +234,7 @@ export default class Ship { } // TODO obtain shield boost - //return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, this.shieldMultiplier + (multiplierDelta || 0)); + // return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, this.shieldMultiplier + (multiplierDelta || 0)); return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, 0 + (multiplierDelta || 0)); }