age_unit accidentally returned AT_AGE_REMOVE (caused by a recent change to curse_age)

This commit is contained in:
Enno Rehling 2015-08-25 22:50:58 +02:00
parent 89bc83c4ab
commit 5fc1587879
3 changed files with 4 additions and 4 deletions

View File

@ -131,7 +131,7 @@ int curse_age(attrib * a)
else if (c->duration != INT_MAX) { else if (c->duration != INT_MAX) {
c->duration = _max(0, c->duration - 1); 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) void destroy_curse(curse * c)

View File

@ -256,7 +256,7 @@ int a_age(attrib ** p)
if (a->type->age) { if (a->type->age) {
int result = a->type->age(a); int result = a->type->age(a);
assert(result >= 0 || !"age() returned a negative value"); assert(result >= 0 || !"age() returned a negative value");
if (result == 0) { if (result == AT_AGE_REMOVE) {
a_remove(p, a); a_remove(p, a);
continue; continue;
} }

View File

@ -90,8 +90,8 @@ extern "C" {
#define AT_READ_OK 0 #define AT_READ_OK 0
#define AT_READ_FAIL -1 #define AT_READ_FAIL -1
#define AT_AGE_KEEP 0 /* keep the attribute for another turn */ #define AT_AGE_REMOVE 0 /* remove the attribute after calling age() */
#define AT_AGE_REMOVE 1 /* remove the attribute after calling age() */ #define AT_AGE_KEEP 1 /* keep the attribute for another turn */
#ifdef __cplusplus #ifdef __cplusplus
} }