mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 16:53:02 +00:00
Fix modification value for additive modifications
This commit is contained in:
@@ -59,22 +59,20 @@ 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];
|
const modValue = this.getModValue(name);
|
||||||
if (result) {
|
if (modValue) {
|
||||||
const modValue = this.getModValue(name);
|
if (additive) {
|
||||||
if (modValue) {
|
result = result + modValue;
|
||||||
if (additive) {
|
} else {
|
||||||
result = result + modValue;
|
result = result * (1 + modValue);
|
||||||
} else {
|
|
||||||
result = result * (1 + modValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user