Builder: Engine error when trying to start freestanding walls inside other walls

Summary:
Normally freestanding walls can’t cross other freestanding walls or wall contours. However it is currently possible to start a wall inside another wall by switching “Building vision” to half-view. However, trying to add such a wall to a template always results in an error.

Steps to reproduce:

  1. Start planning a building and add a wall (either a contour or a freestanding one)
  2. Switch “Building vision” to half-view (when it makes half of the building transparent)
  3. Rotate the screen to make a part of your wall transparent.
  4. Add a new freestanding wall starting (or ending) inside the invisible one. You will get this error.

Expected Results:
There can be several expected results.

  1. The easy one. Builder should not allow starting or ending walls inside other walls (even if they are transparent). Now it is only valid for visible walls (wall crossings however are already forbidden for all walls, even invisible ones).
  2. Allow adding such walls, but make the beam that happens to be inside another wall to be ignored during construction (adjoining wall gets overridden)
  3. Allow adding such walls, but make the beam placed inside another wall to be constructed instead of this wall’s blocks (adjoining wall override)
  4. Allow crossections in general, with either option 2 or 3 for border cases.

Actual Results:

release-689 (x64)[M]...th/services/client/build_editor/wall_loop_editor.lua:205: assertion failed!stack traceback:
	[C]: ?
	[C]: in function 'assert'
	...th/services/client/build_editor/wall_loop_editor.lua:205: in function <...th/services/client/build_editor/wall_loop_editor.lua:204>

release-689 (x64)[M]stonehearth/components/wall/wall_component.lua:369: attempt to index a nil valuestack traceback:
	[C]: ?
	stonehearth/components/wall/wall_component.lua:369: in function 'connect_to_columns'
	stonehearth/services/server/build/build_service.lua:1264: in function 'init_fn'
	stonehearth/services/server/build/build_service.lua:529: in function '_create_blueprint'
	stonehearth/services/server/build/build_service.lua:1262: in function '_create_wall'
	stonehearth/services/server/build/build_service.lua:1249: in function '_add_wall_span'
	stonehearth/services/server/build/build_service.lua:1034: in function 'add_wall'
	stonehearth/services/server/build/build_service.lua:159: in function 'cb'
	stonehearth/services/server/build/build_service.lua:1582: in function 'do_command'
	stonehearth/services/server/build/build_service.lua:158: in function <stonehearth/services/server/build/build_service.lua:156>

release-689 (x64)[M]c++ exception: lua runtime errorstack traceback:

Notes:
This error does not crush the game but makes any further building attempts to throw more errors. The only known solution is to relaunch the game.

Attachments:
Wall is added from right to left, only left beam is visible.

Version Number:
a20r689