move "do not accidentally terrafomr" logic to gmtool.

This commit is contained in:
Enno Rehling 2017-12-26 13:29:19 +01:00
parent f4388f4429
commit c78fe1ac0a
2 changed files with 6 additions and 6 deletions

View File

@ -565,7 +565,9 @@ static void terraform_at(coordinate * c, const terrain_type * terrain)
if (r == NULL) {
r = new_region(nx, ny, c->pl, 0);
}
terraform_region(r, terrain);
if (!(r->units && fval(r->terrain, LAND_REGION) && !fval(terrain, LAND_REGION))) {
terraform_region(r, terrain);
}
}
}
@ -589,7 +591,9 @@ terraform_selection(selection * selected, const terrain_type * terrain)
if (r == NULL) {
r = new_region(nx, ny, pl, 0);
}
terraform_region(r, terrain);
if (!(r->units && fval(r->terrain, LAND_REGION) && !fval(terrain, LAND_REGION))) {
terraform_region(r, terrain);
}
tp = &t->nexthash;
}
}

View File

@ -1060,10 +1060,6 @@ void terraform_region(region * r, const terrain_type * terrain)
rawmaterial **lrm = &r->resources;
assert(terrain);
if (r->units && fval(r->terrain, LAND_REGION) && !fval(terrain, LAND_REGION)) {
log_error("region %s contains units, not terraforming it to %s.", regionname(r, NULL), terrain->_name);
return;
}
while (*lrm) {
rawmaterial *rm = *lrm;
const resource_type *rtype = NULL;