forked from github/server
mapper: settg breaks when you have no luxuries
This commit is contained in:
parent
eaf1c0f447
commit
7fcdcf10dd
|
@ -1158,15 +1158,14 @@ void
|
||||||
settg(region *r)
|
settg(region *r)
|
||||||
{
|
{
|
||||||
const luxury_type * ltype;
|
const luxury_type * ltype;
|
||||||
int g=0;
|
int g = get_maxluxuries();
|
||||||
if (tradegood==NULL) tradegood = luxurytypes;
|
if (tradegood==NULL) tradegood = luxurytypes;
|
||||||
|
|
||||||
for (ltype=luxurytypes; ltype; ltype=ltype->next) {
|
for (ltype=luxurytypes; ltype; ltype=ltype->next) {
|
||||||
if (ltype!=tradegood) r_setdemand(r, ltype, 1 + rand() % 5);
|
if (ltype!=tradegood) r_setdemand(r, ltype, 1 + rand() % 5);
|
||||||
++g;
|
|
||||||
}
|
}
|
||||||
r_setdemand(r, tradegood, 0);
|
r_setdemand(r, tradegood, 0);
|
||||||
if (rand()%100 < 20) {
|
if (g>0 && chance(0.2)) {
|
||||||
int t = rand() % g;
|
int t = rand() % g;
|
||||||
|
|
||||||
for (tradegood = luxurytypes;t;--t) {
|
for (tradegood = luxurytypes;t;--t) {
|
||||||
|
|
Loading…
Reference in New Issue