Fix modification value for additive modifications

This commit is contained in:
Cmdr McDonald
2016-11-10 15:18:05 +00:00
parent 0688faac93
commit 5b81a0b25f

View File

@@ -59,10 +59,8 @@ export default class Module {
* @return {Number} the mass of this module * @return {Number} the mass of this module
*/ */
_getModifiedValue(name, additive) { _getModifiedValue(name, additive) {
let result = 0; let result = this[name] || (additive ? 0 : null); // Additive NULL === 0
if (this[name]) { if (result != null) {
result = this[name];
if (result) {
const modValue = this.getModValue(name); const modValue = this.getModValue(name);
if (modValue) { if (modValue) {
if (additive) { if (additive) {
@@ -72,9 +70,9 @@ export default class Module {
} }
} }
} }
}
return result; return result;
} }
/** /**
* Get the power generation of this module, taking in to account modifications * Get the power generation of this module, taking in to account modifications
* @return {Number} the power generation of this module * @return {Number} the power generation of this module