forked from github/server
more code that fails when there are no luxuries
This commit is contained in:
parent
38062fa990
commit
ba2e0fef8c
|
@ -2067,8 +2067,9 @@ expandselling(region * r, request * sellorders, int limit)
|
|||
|
||||
if (++counter[i] > max_products) {
|
||||
int d = r_demand(r, ltype);
|
||||
if (d > 1)
|
||||
r_setdemand(r, ltype, d-1);
|
||||
if (d > 1) {
|
||||
r_setdemand(r, ltype, d-1);
|
||||
}
|
||||
counter[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -670,6 +670,9 @@ void
|
|||
r_setdemand(region * r, const luxury_type * ltype, int value)
|
||||
{
|
||||
struct demand * d, ** dp = &r->land->demands;
|
||||
|
||||
if (ltype==NULL) return;
|
||||
|
||||
while (*dp && (*dp)->type != ltype) dp = &(*dp)->next;
|
||||
d = *dp;
|
||||
if (!d) {
|
||||
|
|
Loading…
Reference in New Issue