Skip to content

Commit

Permalink
fix overcounting of total tiles when there are invalid tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Sep 6, 2024
1 parent fe17323 commit 694432d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/quickfort/building.lua
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ function check_tiles_and_extents(ctx, buildings)
-- as invalid; the building can still build around it
owns_preview =
quickfort_preview.set_preview_tile(ctx, pos,
is_valid_tile or db_entry.has_extents)
is_valid_tile or db_entry.has_extents or false)
if not is_valid_tile then
log('tile not usable: (%d, %d, %d)', pos.x, pos.y, pos.z)
col[extent_y] = false
Expand Down
2 changes: 1 addition & 1 deletion internal/quickfort/preview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ end
function set_preview_tile(ctx, pos, is_valid_tile, override)
local preview = ctx.preview
if not preview then return false end
local preview_row = ensure_key(ensure_key(ctx.preview.tiles, pos.z), pos.y)
local preview_row = ensure_keys(ctx.preview.tiles, pos.z, pos.y)
if preview_row[pos.x] == nil then
preview.total_tiles = preview.total_tiles + 1
end
Expand Down

0 comments on commit 694432d

Please sign in to comment.