mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Fix up jitter
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user