make all the rset-asserts look the same

This commit is contained in:
Enno Rehling 2016-01-24 14:57:36 +01:00
parent 5072d59636
commit fa130d9ce5
1 changed files with 6 additions and 2 deletions

View File

@ -605,6 +605,7 @@ int rpeasants(const region * r)
void rsetpeasants(region * r, int value) void rsetpeasants(region * r, int value)
{ {
assert(r->land || value==0);
assert(value >= 0); assert(value >= 0);
if (r->land) { if (r->land) {
r->land->peasants = value; r->land->peasants = value;
@ -632,8 +633,11 @@ int rhorses(const region * r)
void rsetmoney(region * r, int value) void rsetmoney(region * r, int value)
{ {
if (r->land) r->land->money = value; assert(r->land || value==0);
else assert(value >= 0); assert(value >= 0);
if (r->land) {
r->land->money = value;
}
} }
void r_setdemand(region * r, const luxury_type * ltype, int value) void r_setdemand(region * r, const luxury_type * ltype, int value)