1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

fixed rotating non-rotatable buildings as blueprints and made blocker non-rotatable

This commit is contained in:
Sense101 2021-06-24 16:47:59 +01:00
parent c12be469dd
commit 20c24f5997
2 changed files with 7 additions and 5 deletions

View File

@ -101,8 +101,11 @@ export class Blueprint {
const entity = this.entities[i]; const entity = this.entities[i];
const staticComp = entity.components.StaticMapEntity; const staticComp = entity.components.StaticMapEntity;
staticComp.rotation = (staticComp.rotation + 90) % 360; if (staticComp.getMetaBuilding().getIsRotateable()) {
staticComp.originalRotation = (staticComp.originalRotation + 90) % 360; staticComp.rotation = (staticComp.rotation + 90) % 360;
staticComp.originalRotation = (staticComp.originalRotation + 90) % 360;
}
staticComp.origin = staticComp.origin.rotateFastMultipleOf90(90); staticComp.origin = staticComp.origin.rotateFastMultipleOf90(90);
} }
} }

View File

@ -158,10 +158,9 @@ export class MetaBuilding {
/** /**
* Returns whether this building is rotateable * Returns whether this building is rotateable
* @param {string} variant
* @returns {boolean} * @returns {boolean}
*/ */
getIsRotateable(variant) { getIsRotateable() {
return true; return true;
} }
@ -243,7 +242,7 @@ export class MetaBuilding {
* @return {{ rotation: number, rotationVariant: number, connectedEntities?: Array<Entity> }} * @return {{ rotation: number, rotationVariant: number, connectedEntities?: Array<Entity> }}
*/ */
computeOptimalDirectionAndRotationVariantAtTile({ root, tile, rotation, variant, layer }) { computeOptimalDirectionAndRotationVariantAtTile({ root, tile, rotation, variant, layer }) {
if (!this.getIsRotateable(variant)) { if (!this.getIsRotateable()) {
return { return {
rotation: 0, rotation: 0,
rotationVariant: 0, rotationVariant: 0,