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

move staticEntities to relevant scope

This commit is contained in:
EmeraldBlock 2021-06-03 13:05:56 -05:00
parent e92c0111b4
commit 3f9229dc7c

View File

@ -142,13 +142,12 @@ export class HUDScreenshotExporter extends BaseHUDPart {
doExport(resolution, overlay, wiresLayer, bounds) {
logger.log("Starting export ...");
// Find extends
const staticEntities = this.root.entityMgr.getAllWithComponent(StaticMapEntityComponent);
if (!bounds) {
// Find extends
const staticEntities = this.root.entityMgr.getAllWithComponent(StaticMapEntityComponent);
const minTile = new Vector(0, 0);
const maxTile = new Vector(0, 0);
for (let i = 0; i < staticEntities.length; ++i) {
const entityBounds = staticEntities[i].components.StaticMapEntity.getTileSpaceBounds();
minTile.x = Math.min(minTile.x, entityBounds.x);