Skip to content

Commit a52850a

Browse files
committed
Use correct stairtype for single-layer stair designations
1 parent f72ccf6 commit a52850a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Template for new versions:
3232
## New Features
3333

3434
## Fixes
35+
- `gui/design`: designating a single-level stair construction now properly follows the selected stair type.
3536

3637
## Misc Improvements
3738

gui/design.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,8 +1345,15 @@ function Design:get_designation(point)
13451345
if mode.desig == 'i' then
13461346
local stairs_top_type = self.subviews.stairs_top_subtype:getOptionValue()
13471347
local stairs_bottom_type = self.subviews.stairs_bottom_subtype:getOptionValue()
1348+
local stairs_only_type = self.subviews.stairs_only_subtype:getOptionValue()
13481349
if point.z == 0 then
1349-
return stairs_bottom_type == 'auto' and 'u' or stairs_bottom_type
1350+
if view_bounds.z1 == view_bounds.z2 then
1351+
-- Single layer staircase
1352+
return stairs_only_type
1353+
else
1354+
-- Bottom of multi-level staircase
1355+
return stairs_bottom_type == 'auto' and 'u' or stairs_bottom_type
1356+
end
13501357
elseif view_bounds and point.z == math.abs(view_bounds.z1 - view_bounds.z2) then
13511358
local pos = Point{x=view_bounds.x1, y=view_bounds.y1, z=view_bounds.z1} + point
13521359
local tile_type = dfhack.maps.getTileType(xyz2pos(pos.x, pos.y, pos.z))

0 commit comments

Comments
 (0)