forked from github/server
age_unit accidentally returned AT_AGE_REMOVE (caused by a recent change to curse_age)
This commit is contained in:
parent
3a1444f378
commit
e217a4b550
|
@ -131,7 +131,7 @@ int curse_age(attrib * a)
|
|||
else if (c->duration != INT_MAX) {
|
||||
c->duration = _max(0, c->duration - 1);
|
||||
}
|
||||
return c->duration;
|
||||
return (c->duration > 0) ? AT_AGE_KEEP : AT_AGE_REMOVE;
|
||||
}
|
||||
|
||||
void destroy_curse(curse * c)
|
||||
|
|
|
@ -256,7 +256,7 @@ int a_age(attrib ** p)
|
|||
if (a->type->age) {
|
||||
int result = a->type->age(a);
|
||||
assert(result >= 0 || !"age() returned a negative value");
|
||||
if (result == 0) {
|
||||
if (result == AT_AGE_REMOVE) {
|
||||
a_remove(p, a);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -90,8 +90,8 @@ extern "C" {
|
|||
#define AT_READ_OK 0
|
||||
#define AT_READ_FAIL -1
|
||||
|
||||
#define AT_AGE_KEEP 0 /* keep the attribute for another turn */
|
||||
#define AT_AGE_REMOVE 1 /* remove the attribute after calling age() */
|
||||
#define AT_AGE_REMOVE 0 /* remove the attribute after calling age() */
|
||||
#define AT_AGE_KEEP 1 /* keep the attribute for another turn */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue