Compare commits

...

6 Commits
2.9.5 ... 2.9.6

Author SHA1 Message Date
willyb321
f3bc900f16 Merge branch 'release/2.9.6' 2018-04-22 07:00:47 +10:00
willyb321
38842417b0 bump 2018-04-22 06:59:08 +10:00
willyb321
82d485a98e fix preset rolls locked to low value 2018-04-22 06:49:43 +10:00
willyb321
fac71feea7 Lowercase armour check
Fixes #231
2018-04-21 12:56:51 +10:00
willyb321
ec148847a9 Merge branch 'develop' 2018-04-21 11:39:19 +10:00
willyb321
445c63878b add guard for tooltips crashing the import 2018-04-21 11:39:02 +10:00
3 changed files with 10 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "coriolis_shipyard", "name": "coriolis_shipyard",
"version": "2.9.5", "version": "2.9.6",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/EDCD/coriolis" "url": "https://github.com/EDCD/coriolis"

View File

@@ -12,6 +12,9 @@ import { Modifications } from 'coriolis-data/dist';
*/ */
export function blueprintTooltip(translate, blueprint, engineers, grp, m) { export function blueprintTooltip(translate, blueprint, engineers, grp, m) {
const effects = []; const effects = [];
if (!blueprint || !blueprint.features) {
return undefined;
}
for (const feature in blueprint.features) { for (const feature in blueprint.features) {
const featureIsBeneficial = isBeneficial(feature, blueprint.features[feature]); const featureIsBeneficial = isBeneficial(feature, blueprint.features[feature]);
const featureDef = Modifications.modifications[feature]; const featureDef = Modifications.modifications[feature];
@@ -259,7 +262,7 @@ export function setPercent(ship, m, percent) {
ship.clearModifications(m); ship.clearModifications(m);
const features = m.blueprint.grades[m.blueprint.grade].features; const features = m.blueprint.grades[m.blueprint.grade].features;
for (const featureName in features) { for (const featureName in features) {
const value = features[featureName][0]; const value = features[featureName][1];
const featureIsBeneficial = isBeneficial(featureName, features[featureName]); const featureIsBeneficial = isBeneficial(featureName, features[featureName]);
if (featureIsBeneficial === true) { if (featureIsBeneficial === true) {
_setValue(ship, m, featureName, (percent / 100) * value); _setValue(ship, m, featureName, (percent / 100) * value);

View File

@@ -148,15 +148,15 @@ export function shipFromJson(json) {
// Add the bulkheads // Add the bulkheads
const armourJson = json.modules.Armour.module; const armourJson = json.modules.Armour.module;
if (armourJson.name.endsWith('_Armour_Grade1')) { if (armourJson.name.toLowerCase().endsWith('_armour_grade1')) {
ship.useBulkhead(0, true); ship.useBulkhead(0, true);
} else if (armourJson.name.endsWith('_Armour_Grade2')) { } else if (armourJson.name.toLowerCase().endsWith('_armour_grade2')) {
ship.useBulkhead(1, true); ship.useBulkhead(1, true);
} else if (armourJson.name.endsWith('_Armour_Grade3')) { } else if (armourJson.name.toLowerCase().endsWith('_armour_grade3')) {
ship.useBulkhead(2, true); ship.useBulkhead(2, true);
} else if (armourJson.name.endsWith('_Armour_Mirrored')) { } else if (armourJson.name.toLowerCase().endsWith('_armour_mirrored')) {
ship.useBulkhead(3, true); ship.useBulkhead(3, true);
} else if (armourJson.name.endsWith('_Armour_Reactive')) { } else if (armourJson.name.toLowerCase().endsWith('_armour_reactive')) {
ship.useBulkhead(4, true); ship.useBulkhead(4, true);
} else { } else {
throw 'Unknown bulkheads "' + armourJson.name + '"'; throw 'Unknown bulkheads "' + armourJson.name + '"';