speeding up default_wage a little bit.

This commit is contained in:
Enno Rehling 2016-09-16 21:12:03 +02:00
parent 567083c9e8
commit 74ff763b22
1 changed files with 21 additions and 18 deletions

View File

@ -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);
int esize = 0;
double wage;
attrib *a;
const struct curse_type *ctype;
if (b != NULL) {
/* TODO: this reveals imaginary castles */
@ -963,23 +961,28 @@ default_wage(const region * r, const faction * f, const race * rc, int in_turn)
}
}
/* Godcurse: Income -10 */
if (curse_active(get_curse(r->attribs, ct_find("godcursezone")))) {
wage = _max(0, wage - 10);
if (r->attribs) {
attrib *a;
const struct curse_type *ctype;
/* Godcurse: Income -10 */
ctype = ct_find("godcursezone");
if (ctype && curse_active(get_curse(r->attribs, ctype))) {
wage = _max(0, wage - 10);
}
/* Bei einer Dürre verdient man nur noch ein Viertel */
ctype = ct_find("drought");
if (ctype) {
curse *c = get_curse(r->attribs, ctype);
if (curse_active(c))
wage /= curse_geteffect(c);
}
a = a_find(r->attribs, &at_reduceproduction);
if (a) {
wage = (wage * a->data.sa[0]) / 100;
}
}
/* Bei einer Dürre verdient man nur noch ein Viertel */
ctype = ct_find("drought");
if (ctype) {
curse *c = get_curse(r->attribs, ctype);
if (curse_active(c))
wage /= curse_geteffect(c);
}
a = a_find(r->attribs, &at_reduceproduction);
if (a)
wage = (wage * a->data.sa[0]) / 100;
return (int)wage;
}