From 009e9f8e4e8e18ef1b2d9aebf7132a17278ddbbc Mon Sep 17 00:00:00 2001 From: plule <630159+plule@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:15:12 +0200 Subject: [PATCH] Cleanup: Remove redundant checks for opentiles --- build-now.lua | 5 +---- deep-embark.lua | 6 +----- modtools/create-unit.lua | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/build-now.lua b/build-now.lua index 0008bab42e..f14e0d1bdc 100644 --- a/build-now.lua +++ b/build-now.lua @@ -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. diff --git a/deep-embark.lua b/deep-embark.lua index c72447a301..5953ae0dac 100644 --- a/deep-embark.lua +++ b/deep-embark.lua @@ -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) diff --git a/modtools/create-unit.lua b/modtools/create-unit.lua index 531497b6d5..687be8ae13 100644 --- a/modtools/create-unit.lua +++ b/modtools/create-unit.lua @@ -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