forked from github/server
use curse_type caching in att_modification
This commit is contained in:
parent
eb8376ef70
commit
e7739867df
1 changed files with 6 additions and 2 deletions
|
@ -1279,8 +1279,12 @@ static int att_modification(const unit * u, skill_t sk)
|
||||||
|
|
||||||
if (u->attribs) {
|
if (u->attribs) {
|
||||||
curse *c;
|
curse *c;
|
||||||
const curse_type *skillmod_ct = ct_find("skillmod");
|
static int cache;
|
||||||
const curse_type *worse_ct = ct_find("worse");
|
static const curse_type *skillmod_ct, *worse_ct;
|
||||||
|
if (ct_changed(&cache)) {
|
||||||
|
skillmod_ct = ct_find("skillmod");
|
||||||
|
worse_ct = ct_find("worse");
|
||||||
|
}
|
||||||
c = get_curse(u->attribs, worse_ct);
|
c = get_curse(u->attribs, worse_ct);
|
||||||
if (c != NULL)
|
if (c != NULL)
|
||||||
result += curse_geteffect(c);
|
result += curse_geteffect(c);
|
||||||
|
|
Loading…
Reference in a new issue