remove unnecessary assert that prevents throwing away money on an ocean

github issue #437
https://bugs.eressea.de/view.php?id=2173#c6411
This commit is contained in:
Enno Rehling 2015-12-16 13:32:02 +01:00
parent 60ea74ce50
commit fa55f84b41
2 changed files with 7 additions and 9 deletions

View file

@ -588,7 +588,9 @@ struct order *ord)
use += use +=
use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK, use_pooled(s, item2resource(itype), GET_RESERVE | GET_POOLED_SLACK,
n - use); n - use);
rsetmoney(s->region, rmoney(s->region) + use); if (s->region->land) {
rsetmoney(s->region, rmoney(s->region) + use);
}
return 0; return 0;
} }
return -1; /* use the mechanism */ return -1; /* use the mechanism */

View file

@ -603,8 +603,7 @@ void rsetpeasants(region * r, int value)
if (r->land) { if (r->land) {
assert(value >= 0); assert(value >= 0);
r->land->peasants = value; r->land->peasants = value;
} else }
assert(value == 0);
} }
int rmoney(const region * r) int rmoney(const region * r)
@ -617,8 +616,7 @@ void rsethorses(const region * r, int value)
if (r->land) { if (r->land) {
assert(value >= 0); assert(value >= 0);
r->land->horses = value; r->land->horses = value;
} else }
assert(value == 0);
} }
int rhorses(const region * r) int rhorses(const region * r)
@ -631,8 +629,7 @@ void rsetmoney(region * r, int value)
if (r->land) { if (r->land) {
assert(value >= 0); assert(value >= 0);
r->land->money = value; r->land->money = value;
} else }
assert(value == 0);
} }
int rherbs(const struct region *r) int rherbs(const struct region *r)
@ -645,8 +642,7 @@ void rsetherbs(const struct region *r, int value)
if (r->land) { if (r->land) {
assert(value >= 0); assert(value >= 0);
r->land->herbs = (short)(value); r->land->herbs = (short)(value);
} else }
assert(value == 0);
} }