diff --git a/src/arcologyBuilding/presets.js b/src/arcologyBuilding/presets.js index 08264eaeee291414f92f8d4ad8df04f75cd4f2cb..d48b061d2fcac799248f0b6aef0d838ea6b42736 100644 --- a/src/arcologyBuilding/presets.js +++ b/src/arcologyBuilding/presets.js @@ -80,9 +80,9 @@ App.Arcology.presets = (function() { */ function templateToBuilding(template) { const sections = []; - const layout = template.shift(); - for (let sectionTemplate of template) { - sections.push(getSection(sectionTemplate)); + const layout = template[0]; + for (let i = 1; i < template.length; i++) { + sections.push(getSection(template[i])); } return new App.Arcology.Building(layout, sections); @@ -213,9 +213,7 @@ App.Arcology.presets = (function() { apply() {} }, { isAllowed: env => env.established && Math.random() < 0.1, - construct: () => { - return templateToBuilding(templates.dick); - }, + construct: () => { return templateToBuilding(templates.dick); }, apply() {} }, ]; @@ -241,7 +239,8 @@ App.Arcology.upgrades = function(building) { * @typedef upgrade * @property {string} id used to identify already build upgrades, unique! * @property {Array<string>} layouts - * @property {Array<string>} exclusive any upgrade is always exclusive to itself. NOTE: keep in mind that exclusiveness has to be added to both upgrades! + * @property {Array<string>} exclusive any upgrade is always exclusive to itself. NOTE: keep in mind that + * exclusiveness has to be added to both upgrades! * @property {string} name as shown to player. * @property {string} desc Fits in a sentence like this: The next major upgrade needed is "desc" * @property {number} cost diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index 560504d9d50031e02d891c2533479f983dc46e8b..d899cb28d9035473511c7a2a2580cff2995fdc3e 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -945,6 +945,9 @@ App.Update.globalVariables = function(node) { if (V.arcologyUpgrade.spire === 1 && !V.building.usedUpgrades.includes("spire")) { V.building.usedUpgrades.push("spire"); } + if (!V.building.sections.map(s => s.id).includes("penthouse")) { + V.building.sections.push(new App.Arcology.Section("penthouse", [[new App.Arcology.Cell.Penthouse()]])); + } if (jQuery.isEmptyObject(V.trinkets)) { V.trinkets = [];