From 20c24f5997cade6aee3c0e737edc88143c1df558 Mon Sep 17 00:00:00 2001 From: Sense101 <67970865+Sense101@users.noreply.github.com> Date: Thu, 24 Jun 2021 16:47:59 +0100 Subject: [PATCH 1/2] fixed rotating non-rotatable buildings as blueprints and made blocker non-rotatable --- src/js/game/blueprint.js | 7 +++++-- src/js/game/meta_building.js | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/game/blueprint.js b/src/js/game/blueprint.js index 3e7cdaa6..a2aa7186 100644 --- a/src/js/game/blueprint.js +++ b/src/js/game/blueprint.js @@ -101,8 +101,11 @@ export class Blueprint { const entity = this.entities[i]; const staticComp = entity.components.StaticMapEntity; - staticComp.rotation = (staticComp.rotation + 90) % 360; - staticComp.originalRotation = (staticComp.originalRotation + 90) % 360; + if (staticComp.getMetaBuilding().getIsRotateable()) { + staticComp.rotation = (staticComp.rotation + 90) % 360; + staticComp.originalRotation = (staticComp.originalRotation + 90) % 360; + } + staticComp.origin = staticComp.origin.rotateFastMultipleOf90(90); } } diff --git a/src/js/game/meta_building.js b/src/js/game/meta_building.js index f3df0b62..7bfbce25 100644 --- a/src/js/game/meta_building.js +++ b/src/js/game/meta_building.js @@ -158,10 +158,9 @@ export class MetaBuilding { /** * Returns whether this building is rotateable - * @param {string} variant * @returns {boolean} */ - getIsRotateable(variant) { + getIsRotateable() { return true; } @@ -243,7 +242,7 @@ export class MetaBuilding { * @return {{ rotation: number, rotationVariant: number, connectedEntities?: Array }} */ computeOptimalDirectionAndRotationVariantAtTile({ root, tile, rotation, variant, layer }) { - if (!this.getIsRotateable(variant)) { + if (!this.getIsRotateable()) { return { rotation: 0, rotationVariant: 0, From cb1a7292886aed23eb96563a273e6c808aaddc54 Mon Sep 17 00:00:00 2001 From: Sense101 <67970865+Sense101@users.noreply.github.com> Date: Thu, 24 Jun 2021 18:27:59 +0100 Subject: [PATCH 2/2] added back easter egg --- src/js/game/blueprint.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/js/game/blueprint.js b/src/js/game/blueprint.js index a2aa7186..3e7cdaa6 100644 --- a/src/js/game/blueprint.js +++ b/src/js/game/blueprint.js @@ -101,11 +101,8 @@ export class Blueprint { const entity = this.entities[i]; const staticComp = entity.components.StaticMapEntity; - if (staticComp.getMetaBuilding().getIsRotateable()) { - staticComp.rotation = (staticComp.rotation + 90) % 360; - staticComp.originalRotation = (staticComp.originalRotation + 90) % 360; - } - + staticComp.rotation = (staticComp.rotation + 90) % 360; + staticComp.originalRotation = (staticComp.originalRotation + 90) % 360; staticComp.origin = staticComp.origin.rotateFastMultipleOf90(90); } }