Fix crash when changing level size

master
Wuzzy 2022-03-06 16:35:26 +01:00
parent 89d06d6b34
commit ec4ddf3d11
1 changed files with 9 additions and 7 deletions

View File

@ -222,9 +222,17 @@ end
-- Either one of these (or none of them for empty room):
-- - level: level ID (for builtin level)
-- - schematic: Path to schematic
-- - nodes: Table containing:
-- - nodes (optional): Table containing node names of level border nodes:
-- - node_floor, node_ceiling, node_wall, node_window
function lzr_levels.build_room(room_data)
if not room_data.nodes then
room_data.nodes = {
node_floor = FLOOR_NODE,
node_wall = WALL_NODE,
node_ceiling = CEILING_NODE,
node_window = WINDOW_NODE,
}
end
prepare_room(room_data)
end
@ -239,12 +247,6 @@ function lzr_levels.prepare_and_build_level(level, spawn_pos, yaw)
end
function lzr_levels.prepare_and_build_custom_level(schematic, spawn_pos, yaw)
local nodes = {
node_floor = FLOOR_NODE,
node_wall = WALL_NODE,
node_ceiling = CEILING_NODE,
node_window = WINDOW_NODE,
}
lzr_levels.build_room({pos=lzr_globals.LEVEL_POS, size=schematic.size, schematic=schematic, spawn_pos=spawn_pos, yaw=yaw, nodes=nodes})
end