| 885 | } |
| 886 | |
| 887 | bool Buildings::hasSupport(df::coord pos, df::coord2d size) |
| 888 | { |
| 889 | for (int dx = -1; dx <= size.x; dx++) |
| 890 | { |
| 891 | for (int dy = -1; dy <= size.y; dy++) |
| 892 | { |
| 893 | // skip corners |
| 894 | if ((dx < 0 || dx == size.x) && (dy < 0 || dy == size.y)) |
| 895 | continue; |
| 896 | |
| 897 | df::coord tile = pos + df::coord(dx,dy,0); |
| 898 | df::map_block *block = Maps::getTileBlock(tile); |
| 899 | if (!block) |
| 900 | continue; |
| 901 | |
| 902 | df::coord2d btile = df::coord2d(tile) & 15; |
| 903 | if (!isOpenTerrain(block->tiletype[btile.x][btile.y])) |
| 904 | return true; |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | return false; |
| 909 | } |
| 910 | |
| 911 | static int computeMaterialAmount(df::building *bld) |
| 912 | { |
nothing calls this directly
no test coverage detected