mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Merge pull request #381 from EDCD/feature/stats
Modules return null instead of undefined when a value is not given
This commit is contained in:
@@ -136,11 +136,13 @@ export default class Module {
|
||||
* @return {Number} The value queried
|
||||
*/
|
||||
_getValue(name, modified) {
|
||||
let val;
|
||||
if (modified) {
|
||||
return this._getModifiedValue(name);
|
||||
val = this._getModifiedValue(name);
|
||||
} else {
|
||||
return this[name];
|
||||
val = this[name];
|
||||
}
|
||||
return isNaN(val) ? null : val;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,7 +197,7 @@ export default class Module {
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return isNaN(result) ? null : result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -281,7 +281,7 @@ function _addModifications(module, modifiers, blueprint, grade, specialModificat
|
||||
if (modifiers[i].Label.search('Resistance') >= 0) {
|
||||
value = (modifiers[i].Value * 100) - (modifiers[i].OriginalValue * 100);
|
||||
}
|
||||
if (modifiers[i].Label.search('ShieldMultiplier') >= 0) {
|
||||
if (modifiers[i].Label.search('ShieldMultiplier') >= 0 || modifiers[i].Label.search('DefenceModifierHealthMultiplier') >= 0) {
|
||||
value = ((100 + modifiers[i].Value) / (100 + modifiers[i].OriginalValue) * 100 - 100) * 100;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user