Fix crash when changing level size
parent
89d06d6b34
commit
ec4ddf3d11
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue