diff --git a/library/include/modules/Buildings.h b/library/include/modules/Buildings.h index 50cbc898f..256e3b7e6 100644 --- a/library/include/modules/Buildings.h +++ b/library/include/modules/Buildings.h @@ -141,7 +141,9 @@ DFHACK_EXPORT bool getCorrectSize(df::coord2d &size, df::coord2d ¢er, */ DFHACK_EXPORT bool checkFreeTiles(df::coord pos, df::coord2d size, df::building_extents *ext = NULL, - bool create_ext = false, bool allow_occupied = false); + bool create_ext = false, + bool allow_occupied = false, + bool is_civzone = false); /** * Returns the number of tiles included by the extent, or defval. diff --git a/library/modules/Buildings.cpp b/library/modules/Buildings.cpp index 5219395c1..3d708dc92 100644 --- a/library/modules/Buildings.cpp +++ b/library/modules/Buildings.cpp @@ -574,7 +574,9 @@ bool Buildings::getCorrectSize(df::coord2d &size, df::coord2d ¢er, bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size, df::building_extents *ext, - bool create_ext, bool allow_occupied) + bool create_ext, + bool allow_occupied, + bool is_civzone) { bool found_any = false; @@ -609,7 +611,7 @@ bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size, else { auto tile = block->tiletype[btile.x][btile.y]; - if (!HighPassable(tile)) + if (!is_civzone && !HighPassable(tile)) allowed = false; } @@ -659,7 +661,9 @@ static bool checkBuildingTiles(df::building *bld, bool can_change) return Buildings::checkFreeTiles(psize.first, psize.second, &bld->room, can_change && bld->isExtentShaped(), - !bld->isSettingOccupancy()); + !bld->isSettingOccupancy(), + bld->getType() == + df::building_type::Civzone); } int Buildings::countExtentTiles(df::building_extents *ext, int defval)