diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 22fd21d9..0c016384 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -1164,7 +1164,9 @@ export default class Ship { } // We apply diminishing returns to the boosted value - shieldBoost = Math.min(shieldBoost, (1 - Math.pow(Math.E, -0.7 * shieldBoost)) * 2.5); + // (no we don't; FD pulled back on this idea. But leave this here in case they reinstate it) + // shieldBoost = Math.min(shieldBoost, (1 - Math.pow(Math.E, -0.7 * shieldBoost)) * 2.5); + shield = shield * shieldBoost; this.shield = shield; diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js index d0da068a..11030548 100644 --- a/src/app/utils/CompanionApiUtils.js +++ b/src/app/utils/CompanionApiUtils.js @@ -241,18 +241,28 @@ export function shipFromJson(json) { // Add internal compartments let internalSlotNum = 1; + let militarySlotNum = 1; for (let i in shipTemplate.slots.internal) { const internalClassNum = isNaN(shipTemplate.slots.internal[i]) ? shipTemplate.slots.internal[i].class : shipTemplate.slots.internal[i]; + const isMilitary = isNaN(shipTemplate.slots.internal[i]) ? shipTemplate.slots.internal[i].name == 'Military' : false; + // The internal slot might be a standard or a military slot. Military slots have a different naming system let internalSlot = null; - while (internalSlot === null && internalSlotNum < 99) { - // Slot numbers are not contiguous so handle skips - const internalName = 'Slot' + (internalSlotNum <= 9 ? '0' : '') + internalSlotNum + '_Size' + internalClassNum; - if (json.modules[internalName]) { - internalSlot = json.modules[internalName]; + if (isMilitary) { + const internalName = 'Military0' + militarySlotNum; + internalSlot = json.modules[internalName]; + militarySlotNum++; + } else { + while (internalSlot === null && internalSlotNum < 99) { + // Slot numbers are not contiguous so handle skips + const internalName = 'Slot' + (internalSlotNum <= 9 ? '0' : '') + internalSlotNum + '_Size' + internalClassNum; + if (json.modules[internalName]) { + internalSlot = json.modules[internalName]; + } + internalSlotNum++; } - internalSlotNum++; } + if (!internalSlot) { // This can happen with old imports that don't contain new slots } else if (!internalSlot.module) {