From b66bf5ac8ac0ac09d90cb653bb5a15c8da984791 Mon Sep 17 00:00:00 2001 From: Sense101 <67970865+Sense101@users.noreply.github.com> Date: Sat, 22 Jan 2022 21:16:08 +0000 Subject: [PATCH] Fix building placer checking on wrong layer for acceptors and ejectors --- src/js/game/hud/parts/building_placer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index ca9c128b..058d8aec 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -571,11 +571,13 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { let isConnected = false; // Find all entities which are on that tile - const sourceEntities = this.root.map.getLayersContentsMultipleXY(sourceTile.x, sourceTile.y); + const sourceEntity = this.root.map.getLayerContentXY( + sourceTile.x, + sourceTile.y, + this.fakeEntity.layer + ); - // Check for every entity: - for (let j = 0; j < sourceEntities.length; ++j) { - const sourceEntity = sourceEntities[j]; + if (sourceEntity) { const sourceEjector = sourceEntity.components.ItemEjector; const sourceBeltComp = sourceEntity.components.Belt; const sourceStaticComp = sourceEntity.components.StaticMapEntity;