From f7700489387b6d3f838bfed71270288501876d8e Mon Sep 17 00:00:00 2001 From: TcePrepK <56453014+TcePrepK@users.noreply.github.com> Date: Fri, 25 Feb 2022 17:38:14 +0300 Subject: [PATCH] Fix for freeEntityAreaBeforeBuild function. Small typo that brings big bug with it. If you try to replace replaceable entity with wired pins, using unreplaceable entity with wired pins, it crashes because it is looking for "replacing entity" instead of "replaced entity". --- src/js/game/systems/wired_pins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/game/systems/wired_pins.js b/src/js/game/systems/wired_pins.js index 9e318795..e73e85f0 100644 --- a/src/js/game/systems/wired_pins.js +++ b/src/js/game/systems/wired_pins.js @@ -147,7 +147,7 @@ export class WiredPinsSystem extends GameSystemWithFilter { const worldPos = entity.components.StaticMapEntity.localTileToWorld(slot.pos); const collidingEntity = this.root.map.getLayerContentXY(worldPos.x, worldPos.y, "wires"); if (collidingEntity) { - const staticComp = entity.components.StaticMapEntity; + const staticComp = collidingEntity.components.StaticMapEntity; assertAlways( staticComp .getMetaBuilding()