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:
parent
c12be469dd
commit
20c24f5997
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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<Entity> }}
|
||||
*/
|
||||
computeOptimalDirectionAndRotationVariantAtTile({ root, tile, rotation, variant, layer }) {
|
||||
if (!this.getIsRotateable(variant)) {
|
||||
if (!this.getIsRotateable()) {
|
||||
return {
|
||||
rotation: 0,
|
||||
rotationVariant: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user