From e4830811b01358a5579e89cd846fcc68304c3cc8 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Thu, 17 Nov 2016 14:23:40 +0000 Subject: [PATCH] Fix up jitter --- src/app/components/Modification.jsx | 4 ++-- src/app/shipyard/Module.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/components/Modification.jsx b/src/app/components/Modification.jsx index 3d6ee9fa..c2b90939 100644 --- a/src/app/components/Modification.jsx +++ b/src/app/components/Modification.jsx @@ -24,7 +24,7 @@ export default class Modification extends TranslatedComponent { constructor(props, context) { super(props); this.state = {}; - this.state.value = this.props.name === 'jitter' ? this.props.m.getModValue(this.props.name) / 10000 : this.props.m.getModValue(this.props.name) / 100 || 0; + this.state.value = this.props.m.getModValue(this.props.name) / 100 || 0; } /** @@ -34,7 +34,7 @@ export default class Modification extends TranslatedComponent { _updateValue(value) { const name = this.props.name; - let scaledValue = name === 'jitter' ? Math.floor(Number(value) * 10000) : Math.floor(Number(value) * 100); + let scaledValue = Math.floor(Number(value) * 100); // Limit to +1000% / -100% if (scaledValue > 100000) { scaledValue = 100000; diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 083f0d73..d995ef16 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -61,7 +61,8 @@ export default class Module { _getModifiedValue(name, additive) { let result = this[name] || (additive ? 0 : null); // Additive NULL === 0 if (result != null) { - const modValue = this.getModValue(name) / 10000; + // Jitter is special, being the only non-percentage value (it is in fact degrees) + const modValue = name === 'jitter' ? this.getModValue(name) / 100 : this.getModValue(name) / 10000; if (modValue) { if (additive) { result = result + modValue;