forked from github/server
speeding up default_wage a little bit.
This commit is contained in:
parent
567083c9e8
commit
74ff763b22
|
@ -922,8 +922,6 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
|
||||||
building *b = largestbuilding(r, &cmp_wage, false);
|
building *b = largestbuilding(r, &cmp_wage, false);
|
||||||
int esize = 0;
|
int esize = 0;
|
||||||
double wage;
|
double wage;
|
||||||
attrib *a;
|
|
||||||
const struct curse_type *ctype;
|
|
||||||
|
|
||||||
if (b != NULL) {
|
if (b != NULL) {
|
||||||
/* TODO: this reveals imaginary castles */
|
/* TODO: this reveals imaginary castles */
|
||||||
|
@ -963,8 +961,12 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r->attribs) {
|
||||||
|
attrib *a;
|
||||||
|
const struct curse_type *ctype;
|
||||||
/* Godcurse: Income -10 */
|
/* Godcurse: Income -10 */
|
||||||
if (curse_active(get_curse(r->attribs, ct_find("godcursezone")))) {
|
ctype = ct_find("godcursezone");
|
||||||
|
if (ctype && curse_active(get_curse(r->attribs, ctype))) {
|
||||||
wage = _max(0, wage - 10);
|
wage = _max(0, wage - 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -977,9 +979,10 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
|
||||||
}
|
}
|
||||||
|
|
||||||
a = a_find(r->attribs, &at_reduceproduction);
|
a = a_find(r->attribs, &at_reduceproduction);
|
||||||
if (a)
|
if (a) {
|
||||||
wage = (wage * a->data.sa[0]) / 100;
|
wage = (wage * a->data.sa[0]) / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
return (int)wage;
|
return (int)wage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue