Skip to content

Commit

Permalink
Merge pull request #768 from plule/cleanup-walkable
Browse files Browse the repository at this point in the history
[cleanup] Remove redundant checks for opentiles
  • Loading branch information
myk002 authored Jul 10, 2023
2 parents 14552dd + 009e9f8 commit ce97af1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions build-now.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,8 @@ local function is_good_dump_pos(pos)
local shape_attrs = df.tiletype_shape.attrs[attrs.shape]
-- reject hidden tiles
if flags.hidden then return false, false end
-- reject unwalkable or open tiles
-- reject unwalkable tiles
if not shape_attrs.walkable then return false, false end
if shape_attrs.basic_shape == df.tiletype_shape_basic.Open then
return false, false
end
-- reject footprints within other buildings. this could potentially be
-- relaxed a bit since we can technically dump items on passable tiles
-- within other buildings, but that would look messy.
Expand Down
6 changes: 1 addition & 5 deletions deep-embark.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ function isValidTiletype(tiletype)
end
end
local shapeAttrs = df.tiletype_shape.attrs[tiletypeAttrs.shape]
if shapeAttrs.walkable and shapeAttrs.basic_shape ~= df.tiletype_shape_basic.Open then -- downward ramps are walkable but open; units placed here would fall
return true
else
return false
end
return shapeAttrs.walkable
end

function getValidEmbarkTiles(block)
Expand Down
2 changes: 1 addition & 1 deletion modtools/create-unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function isValidSpawnLocation(pos, locationType)
end
return false
elseif locationType == 'Walkable' then
if tileShapeAttrs.walkable and tileShapeAttrs.basic_shape ~= df.tiletype_shape_basic.Open then
if tileShapeAttrs.walkable then
return true
end
return false
Expand Down

0 comments on commit ce97af1

Please sign in to comment.