[1.1.34] Crash when attempting to paste lua-script created blueprint with invalid snap-to-grid configuration
Posted: Fri Jun 11, 2021 5:32 pm
I'm creating a (yet to be released) mod that involves programmatically creating/pasting blueprints.
In the mod, using lua, I created a blueprint (inside a container inside a custom surface to hold the LuaItemStack), set blueprint_position_relative_to_grid, but did not set blueprint_snap_to_grid. When I tried to place this blueprint (from lua), the game (not the mod) crashed.
Setting blueprint_snap_to_grid to {1,1} avoided the crash.
I would expect the blueprint pasting to fail gracefully or provide a reasonable default behavior, instead of crashing the game.
In the mod, using lua, I created a blueprint (inside a container inside a custom surface to hold the LuaItemStack), set blueprint_position_relative_to_grid, but did not set blueprint_snap_to_grid. When I tried to place this blueprint (from lua), the game (not the mod) crashed.
Setting blueprint_snap_to_grid to {1,1} avoided the crash.
I would expect the blueprint pasting to fail gracefully or provide a reasonable default behavior, instead of crashing the game.