|
|
@ -32,6 +32,7 @@
|
|
|
|
#include "modules/Constructions.h"
|
|
|
|
#include "modules/Constructions.h"
|
|
|
|
#include "modules/Buildings.h"
|
|
|
|
#include "modules/Buildings.h"
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
|
|
|
|
#include "modules/MapCache.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "TileTypes.h"
|
|
|
|
#include "TileTypes.h"
|
|
|
|
#include "df/job_item.h"
|
|
|
|
#include "df/job_item.h"
|
|
|
@ -455,27 +456,17 @@ static bool is_valid_building_site(building_site &site, bool orthogonal_check, b
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (shape_basic != tiletype_shape_basic::Floor)
|
|
|
|
if (shape != tiletype_shape::STAIR_DOWN && shape_basic != tiletype_shape_basic::Floor)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
if (material == tiletype_material::CONSTRUCTION)
|
|
|
|
// Can build on top of a wall, but not on other construction
|
|
|
|
|
|
|
|
auto construction = Constructions::findAtTile(site.pos);
|
|
|
|
|
|
|
|
if (construction)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Can build on top of a wall, but not on a constructed floor
|
|
|
|
if (construction->flags.bits.top_of_wall==0)
|
|
|
|
df::coord pos_below = site.pos;
|
|
|
|
|
|
|
|
pos_below.z--;
|
|
|
|
|
|
|
|
if (!Maps::isValidTilePos(pos_below))
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto ttype = Maps::getTileType(pos_below);
|
|
|
|
|
|
|
|
if (!ttype)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto shape = tileShape(*ttype);
|
|
|
|
|
|
|
|
auto shapeBasic = tileShapeBasic(shape);
|
|
|
|
|
|
|
|
if (tileShapeBasic(shape) != tiletype_shape_basic::Wall)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (material == tiletype_material::FIRE ||
|
|
|
|
if (material == tiletype_material::FIRE ||
|
|
|
|
material == tiletype_material::POOL ||
|
|
|
|
material == tiletype_material::POOL ||
|
|
|
|
material == tiletype_material::BROOK ||
|
|
|
|
material == tiletype_material::BROOK ||
|
|
|
|