placing a circuit block on a tile shouldn't crash (fixes #78)

This commit is contained in:
Timothy Stiles 2021-11-18 18:19:57 +11:00
parent 96bc4e0a3c
commit 590ecb36ae

View File

@ -1438,7 +1438,7 @@ export class Editor extends PrimaryView {
// Special case: preserve wires when replacing one wired tile with another // Special case: preserve wires when replacing one wired tile with another
if (new_tile.type.contains_wire && if (new_tile.type.contains_wire &&
// FIXME this is hacky garbage // FIXME this is hacky garbage
tile === this.fg_tile && this.fg_tile_from_palette) tile === this.fg_tile && this.fg_tile_from_palette && existing_tile !== undefined)
{ {
if (existing_tile.type.contains_wire) { if (existing_tile.type.contains_wire) {
new_tile.wire_directions = existing_tile.wire_directions; new_tile.wire_directions = existing_tile.wire_directions;