From 21309e129f995906e1aecf72a5e18a82a4e1474f Mon Sep 17 00:00:00 2001 From: Pat Date: Sat, 14 Apr 2018 08:50:48 -0500 Subject: [PATCH 1/4] Fix for issue 245 - check that the passenger property is defined for a slot before calculating total passenger capacity --- src/app/shipyard/Ship.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 0495391e..ce540771 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -1211,7 +1211,9 @@ export default class Ship { } else if (slot.m.grp === 'cr') { cargoCapacity += slot.m.cargo; } else if (slot.m.grp.slice(0,2) === 'pc') { - passengerCapacity += slot.m.passengers + if (slot.m.passengers) { + passengerCapacity += slot.m.passengers; + } } } } From 57c1e83c67664e469750fa9dec8ed10103c450b0 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Tue, 17 Apr 2018 15:01:09 +1000 Subject: [PATCH 2/4] apply new experimentals structure --- src/app/utils/JournalUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/utils/JournalUtils.js b/src/app/utils/JournalUtils.js index b22188bb..88c11d83 100644 --- a/src/app/utils/JournalUtils.js +++ b/src/app/utils/JournalUtils.js @@ -251,7 +251,7 @@ function _addModifications (module, modifiers, blueprint, grade, specialModifica if (!modifiers) return let special if (specialModifications) { - special = Modifications.specials[Object.keys(specialModifications)[0]] + special = Modifications.specials[specialModifications] } for (const i in modifiers) { // Some special modifications From 2d00cbc41bfaa475b86b724931dfeefd50185793 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Tue, 17 Apr 2018 17:31:11 +1000 Subject: [PATCH 3/4] fix more values (hopefully done) also, Fixes #247 by changing passengers to pax --- src/app/components/ShipSummaryTable.jsx | 2 +- src/app/pages/ShipyardPage.jsx | 2 +- src/app/utils/BlueprintFunctions.js | 2 +- src/app/utils/JournalUtils.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/ShipSummaryTable.jsx b/src/app/components/ShipSummaryTable.jsx index c2e0dec2..1ce7068e 100644 --- a/src/app/components/ShipSummaryTable.jsx +++ b/src/app/components/ShipSummaryTable.jsx @@ -53,7 +53,7 @@ export default class ShipSummaryTable extends TranslatedComponent { {translate('TTD')} {/* {translate('HPS')} */} {translate('cargo')} - {translate('passengers')} + {translate('pax')} {translate('fuel')} {translate('mass')} {translate('hrd')} diff --git a/src/app/pages/ShipyardPage.jsx b/src/app/pages/ShipyardPage.jsx index 5debd8bd..09a09182 100644 --- a/src/app/pages/ShipyardPage.jsx +++ b/src/app/pages/ShipyardPage.jsx @@ -346,7 +346,7 @@ export default class ShipyardPage extends Page { {translate('boost')} {translate('jump')} {translate('cargo')} - {translate('passengers')} + {translate('pax')} {translate('core module classes')} {translate('hardpoints')} diff --git a/src/app/utils/BlueprintFunctions.js b/src/app/utils/BlueprintFunctions.js index a65111b7..8b0dd7bc 100644 --- a/src/app/utils/BlueprintFunctions.js +++ b/src/app/utils/BlueprintFunctions.js @@ -228,7 +228,7 @@ export function getBlueprint(name, module) { const findMod = val => Object.keys(Modifications.blueprints).find(elem => elem.toString().toLowerCase().search(val.toString().toLowerCase().replace(/(OutfittingFieldType_|persecond)/igm, '')) >= 0) const found = Modifications.blueprints[findMod(name)]; if (!found || !found.fdname) { - return undefined; + return {}; } const blueprint = JSON.parse(JSON.stringify(found)); if (module) { diff --git a/src/app/utils/JournalUtils.js b/src/app/utils/JournalUtils.js index 88c11d83..fc2cf10f 100644 --- a/src/app/utils/JournalUtils.js +++ b/src/app/utils/JournalUtils.js @@ -266,8 +266,8 @@ function _addModifications (module, modifiers, blueprint, grade, specialModifica if (value === Infinity) { value = modifiers[i].Value * 100; } - if (modifiers[i].Label === 'DefenceModifierHealthMultiplier' && blueprint.toLowerCase().startsWith('armour_')) { - value = modifiers[i].Value * 100 - modifiers[i].OriginalValue; + if (modifiers[i].Label.search('Resistance') >= 0) { + value = (modifiers[i].Value * 100) - (modifiers[i].OriginalValue * 100) } // Carry out the required changes for (const action in modifierActions) { From deaa61b848cf03a5be6620ac5f1c117271918308 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Tue, 17 Apr 2018 17:32:56 +1000 Subject: [PATCH 4/4] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e13b6da6..9710deb8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.9.1", + "version": "2.9.2", "repository": { "type": "git", "url": "https://github.com/EDCD/coriolis"