forked from github/server
fix floating point exception.
This commit is contained in:
parent
108a909131
commit
f1008fa231
|
@ -139,17 +139,20 @@ int fix_demand(region * rd)
|
||||||
const luxury_type *ltypes[MAXLUXURIES];
|
const luxury_type *ltypes[MAXLUXURIES];
|
||||||
const luxury_type *sale = NULL;
|
const luxury_type *sale = NULL;
|
||||||
int maxlux = 0;
|
int maxlux = 0;
|
||||||
static int maxluxuries = 0;
|
static int maxluxuries = -1;
|
||||||
|
|
||||||
|
// TODO: this entire function is impossible to understand
|
||||||
recurse_regions(rd, &rlist, f_nolux);
|
recurse_regions(rd, &rlist, f_nolux);
|
||||||
if (maxluxuries == 0) {
|
if (maxluxuries < 0) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (sale = luxurytypes; sale; sale = sale->next) {
|
for (sale = luxurytypes; sale; sale = sale->next) {
|
||||||
mlux[i] = 0;
|
|
||||||
ltypes[i++] = sale;
|
ltypes[i++] = sale;
|
||||||
}
|
}
|
||||||
maxluxuries = i;
|
maxluxuries = i;
|
||||||
}
|
}
|
||||||
|
if (maxluxuries == 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i != maxluxuries; ++i) {
|
for (i = 0; i != maxluxuries; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue