diff --git a/src/kernel/item.c b/src/kernel/item.c index e6380f400..e9473ff10 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -66,36 +66,34 @@ potion_type *potiontypes; static int res_changeaura(unit * u, const resource_type * rtype, int delta) { assert(rtype != NULL); - change_spellpoints(u, delta); - return 0; + return change_spellpoints(u, delta); } static int res_changeperson(unit * u, const resource_type * rtype, int delta) { assert(rtype != NULL || !"not implemented"); scale_number(u, u->number + delta); - return 0; + return u->number; } static int res_changepermaura(unit * u, const resource_type * rtype, int delta) { assert(rtype != NULL); - change_maxspellpoints(u, delta); - return 0; + return change_maxspellpoints(u, delta); } static int res_changehp(unit * u, const resource_type * rtype, int delta) { assert(rtype != NULL); u->hp += delta; - return 0; + return u->hp; } static int res_changepeasants(unit * u, const resource_type * rtype, int delta) { assert(rtype != NULL && u->region->land); u->region->land->peasants += delta; - return 0; + return u->region->land->peasants; } int res_changeitem(unit * u, const resource_type * rtype, int delta) diff --git a/src/kernel/pool.c b/src/kernel/pool.c index 3fc207b5d..997bb3b30 100644 --- a/src/kernel/pool.c +++ b/src/kernel/pool.c @@ -79,6 +79,7 @@ int change_resource(unit * u, const resource_type * rtype, int change) i = change_maxspellpoints(u, change); else assert(!"undefined resource detected. rtype->uchange not initialized."); + assert(i==get_resource(u, rtype)); assert(i >= 0); if (i >= 100000000) { log_warning("%s has %d %s\n", unitname(u), i, rtype->_name[0]);