It is new for me that this exists in standard. Any field satisfies this conditions:
const grund_t* gr = welt->lookup_kartenboden(pos + d);
if (gr == NULL || gr->get_grund_hang() != hang_t::flach) return false;
if (((1 << welt->get_climate(gr->get_hoehe())) & cl) == 0) {
return false;
}
if (d.x > 0 || d.y > 0) {
if (welt->lookup_kartenboden(pos)->get_hoehe() != gr->get_hoehe()) {
// height wrong!
return false;
}
}
if ( ((dir & ribi_t::sued)!=0 && d.y == h - 1) ||
((dir & ribi_t::west)!=0 && d.x == 0) ||
((dir & ribi_t::nord)!=0 && d.y == 0) ||
((dir & ribi_t::ost)!=0 && d.x == b - 1)) {
// we want to build a road here:
return
gr->get_typ() == grund_t::boden &&
(!gr->hat_wege() || (gr->hat_weg(road_wt) && !gr->has_two_ways())) && // build only on roads, no other ways
!gr->is_halt() &&
gr->kann_alle_obj_entfernen(NULL) == NULL;
} else {
// we want to build the townhall here: maybe replace existing buildings
return ((gr->get_typ()==grund_t::boden && gr->ist_natur()) || gr->get_typ()==grund_t::fundament) &&
gr->kann_alle_obj_entfernen(NULL) == NULL;
}
i.e. is either flat or can be flatted. (It was reported once years ago and then some fixes were applied.)
I tried a lot on mountanieous maps but could not generate a broken townhall.