use curse_type caching in att_modification

This commit is contained in:
Enno Rehling 2016-09-19 03:55:12 +02:00
parent eb8376ef70
commit e7739867df

View file

@ -1279,8 +1279,12 @@ static int att_modification(const unit * u, skill_t sk)
if (u->attribs) {
curse *c;
const curse_type *skillmod_ct = ct_find("skillmod");
const curse_type *worse_ct = ct_find("worse");
static int cache;
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);
if (c != NULL)
result += curse_geteffect(c);