diff --git a/src/app/components/Modification.jsx b/src/app/components/Modification.jsx
index c2b90939..6a1464d4 100644
--- a/src/app/components/Modification.jsx
+++ b/src/app/components/Modification.jsx
@@ -29,12 +29,14 @@ export default class Modification extends TranslatedComponent {
/**
* Update modification given a value.
- * @param {Number} value The value to set
+ * @param {Number} value The value to set. This comes in as a string and must be stored in state as a string,
+ * because it needs to allow illegal 'numbers' ('-', '1.', etc) when the user is typing
+ * in a value by hand
*/
_updateValue(value) {
const name = this.props.name;
- let scaledValue = Math.floor(Number(value) * 100);
+ let scaledValue = Math.round(Number(value) * 100);
// Limit to +1000% / -100%
if (scaledValue > 100000) {
scaledValue = 100000;
diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx
index 6c97fa5c..e93a5eb9 100644
--- a/src/app/pages/OutfittingPage.jsx
+++ b/src/app/pages/OutfittingPage.jsx
@@ -294,7 +294,7 @@ export default class OutfittingPage extends Page {
{ship.name}
-
+
diff --git a/src/app/shipyard/Serializer.js b/src/app/shipyard/Serializer.js
index 58f849d5..aa7515c2 100644
--- a/src/app/shipyard/Serializer.js
+++ b/src/app/shipyard/Serializer.js
@@ -4,6 +4,7 @@ import Ship from './Ship';
import * as ModuleUtils from './ModuleUtils';
import * as Utils from '../utils/UtilityFunctions';
import LZString from 'lz-string';
+import { outfitURL } from '../utils/UrlGenerators';
const STANDARD = ['powerPlant', 'thrusters', 'frameShiftDrive', 'lifeSupport', 'powerDistributor', 'sensors', 'fuelTank'];
@@ -84,7 +85,7 @@ export function toDetailedBuild(buildName, ship) {
ship: ship.name,
references: [{
name: 'Coriolis.io',
- url: `https://coriolis.edcd.io/outfit/${ship.id}/${code}?bn=${encodeURIComponent(buildName)}`,
+ url: 'https://coriolis.edcd.io' + outfitURL(ship.id, code, buildName),
code,
shipId: ship.id
}],
diff --git a/src/app/utils/UrlGenerators.js b/src/app/utils/UrlGenerators.js
index 75182f44..827cc04e 100644
--- a/src/app/utils/UrlGenerators.js
+++ b/src/app/utils/UrlGenerators.js
@@ -6,15 +6,18 @@
* @return {String} URL
*/
export function outfitURL(shipId, code, buildName) {
- let parts = ['/outfit/', shipId];
+ let path = '/outfit/' + shipId;
+
+ let sepChar = '?';
if (code) {
- parts.push('/', code);
+ path = path + sepChar + 'code=' + encodeURIComponent(code);
+ sepChar = '&';
}
if (buildName) {
- parts.push('?bn=', encodeURIComponent(buildName));
+ path = path + sepChar + 'bn=' + encodeURIComponent(buildName);
}
- return parts.join('');
-}
+ return path;
+}