add a safety check against accidentally drowning units in terraforming.

This commit is contained in:
Enno Rehling 2017-12-26 07:04:12 +01:00
parent f4e56d1512
commit a7b7162c56
2 changed files with 4 additions and 10 deletions

View file

@ -170,12 +170,6 @@ static int potion_luck(unit *u, region *r, attrib_type *atype, int amount) {
return amount;
}
static int potion_truth(unit *u) {
UNUSED_ARG(u);
/* TODO: this potion does nothing! */
return 1;
}
static int potion_power(unit *u, int amount) {
int use = u->number / 10;
if (use < amount) {
@ -201,9 +195,6 @@ static int do_potion(unit * u, region *r, const potion_type * ptype, int amount)
else if (ptype == oldpotiontype[P_HORSE]) {
return potion_luck(u, r, &at_horseluck, amount);
}
else if (ptype == oldpotiontype[P_WAHRHEIT]) {
return potion_truth(u);
}
else if (ptype == oldpotiontype[P_MACHT]) {
return potion_power(u, amount);
}

View file

@ -1060,7 +1060,10 @@ 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;