From fe0590503fa680426afe0d1e66f845e71a2de5b1 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Fri, 24 Mar 2023 15:05:17 -0700 Subject: [PATCH] mark tiles with magma or deep water as "not free" --- docs/changelog.txt | 1 + library/modules/Buildings.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 88c6eac3b..11e552abe 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -38,6 +38,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Fixes - `buildingplan`: upright spike traps are now placed extended rather than retracted +- `buildingplan`: you can no longer designate constructions on tiles with magma or deep water - `buildingplan`: fixed material filter getting lost for planning buildings on save/reload - `buildingplan`: respect building size limits (e.g. roads and bridges cannot be more than 31 tiles in any dimension) - `tailor`: now properly discriminates between dyed and undyed cloth, no longer defaults to using adamantine, and properly tracks material requirements for already queued orders diff --git a/library/modules/Buildings.cpp b/library/modules/Buildings.cpp index 1d1ba9318..de87d3fb8 100644 --- a/library/modules/Buildings.cpp +++ b/library/modules/Buildings.cpp @@ -799,10 +799,13 @@ bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size, if (!allow_occupied && block->occupancy[btile.x][btile.y].bits.building) allowed = false; - else + else if (!allow_wall) { - auto tile = block->tiletype[btile.x][btile.y]; - if (!allow_wall && !HighPassable(tile)) + auto &tt = block->tiletype[btile.x][btile.y]; + auto &des = block->designation[btile.x][btile.y]; + if (!HighPassable(tt) || + des.bits.flow_size > 1 || + (des.bits.flow_size >= 1 && des.bits.liquid_type == df::tile_liquid::Magma)) allowed = false; }