|
|
|
@ -520,8 +520,11 @@ static uint16_t get_walk_group(const df::coord & pos) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool is_tree(const df::tiletype *tt) {
|
|
|
|
|
return tileMaterial(*tt) == tiletype_material::TREE ||
|
|
|
|
|
tileMaterial(*tt) == tiletype_material::MUSHROOM;
|
|
|
|
|
return tileMaterial(*tt) == tiletype_material::TREE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool is_tree_trunk(const df::tiletype *tt) {
|
|
|
|
|
return is_tree(tt) && tileShape(*tt)== tiletype_shape::WALL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if the outside tile flag is set
|
|
|
|
@ -596,17 +599,19 @@ static void flood_fill(lua_State *L, bool enable) {
|
|
|
|
|
|
|
|
|
|
// only go one tile outside of a walkability group (trees don't count)
|
|
|
|
|
df::tiletype *tt = Maps::getTileType(pos);
|
|
|
|
|
if (start_walk && start_walk != walk && tt && !is_tree(tt))
|
|
|
|
|
if (start_walk && start_walk != walk && tt && !is_tree_trunk(tt))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
flood.emplace(pos.x-1, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x-1, pos.y, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y, pos.z);
|
|
|
|
|
flood.emplace(pos.x-1, pos.y+1, pos.z);
|
|
|
|
|
flood.emplace(pos.x, pos.y+1, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y+1, pos.z);
|
|
|
|
|
if (tt && tileShape(*tt) != df::tiletype_shape::RAMP_TOP) {
|
|
|
|
|
flood.emplace(pos.x-1, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y-1, pos.z);
|
|
|
|
|
flood.emplace(pos.x-1, pos.y, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y, pos.z);
|
|
|
|
|
flood.emplace(pos.x-1, pos.y+1, pos.z);
|
|
|
|
|
flood.emplace(pos.x, pos.y+1, pos.z);
|
|
|
|
|
flood.emplace(pos.x+1, pos.y+1, pos.z);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!zlevel) {
|
|
|
|
|
df::coord pos_above = pos + df::coord(0, 0, 1);
|
|
|
|
|