diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index 843c90980..93c07ea72 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1142,7 +1142,12 @@ orc_growth(void) for (r = regions; r; r = r->next) { unit *u; for (u = r->units; u; u = u->next) { - curse *c = get_curse(u->attribs, ct_find("orcish")); + static boolean init = false; + static curse *c = 0; + if (!init) { + init = true; + c = get_curse(u->attribs, ct_find("orcish")); + } if (c && !has_skill(u, SK_MAGIC) && !has_skill(u, SK_ALCHEMY) && !fval(u, UFL_HERO)) { int n; diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 4b72b23dd..56f384a35 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -3493,7 +3493,7 @@ init_battle(region * r, battle **bp) order * ord; for (ord=u->orders;ord;ord=ord->next) { - boolean init=false; + static boolean init = false; static const curse_type * peace_ct, * slave_ct, * calm_ct; if (!init) { diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index 5cfa43684..9b08e7893 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -670,7 +670,7 @@ max_spellpoints(const region * r, const unit * u) sk = eff_skill(u, SK_MAGIC, r); msp = u->race->maxaura*(pow(sk, potenz)/divisor+1) + get_spchange(u); - if (get_item(u,I_AURAKULUM) > 0) { + if (get_item(u, I_AURAKULUM) > 0) { msp += use_item_aura(r, u); } n = get_curseeffect(u->attribs, C_AURA, 0); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index 5a36ca27e..306a43162 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -984,15 +984,15 @@ att_modification(const unit *u, skill_t sk) attrib * a; int result = 0; static boolean init = false; - static const curse_type * skillmod_ct; - static const curse_type * gbdream_ct; + static const curse_type * skillmod_ct, * gbdream_ct, * worse_ct; if (!init) { init = true; skillmod_ct = ct_find("skillmod"); gbdream_ct = ct_find("gbdream"); + worse_ct = ct_find("worse"); } - result += get_curseeffect(u->attribs, C_ALLSKILLS, 0); + result += curse_geteffect(get_curse(u->attribs, worse_ct)); if (skillmod_ct) { curse * c; variant var;