diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 5e1657180..b7c10c212 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -726,8 +726,8 @@ give_cmd(unit * u, order * ord) item **itmp=&u->items; while (*itmp) { if ((*itmp)->number > 0 - && (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype) > 0) { - n = (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype); + && (*itmp)->number - get_reservation(u, (*itmp)->type->rtype) > 0) { + n = (*itmp)->number - get_reservation(u, (*itmp)->type->rtype); if (give_item(n, (*itmp)->type, u, u2, ord)==0) continue; } itmp = &(*itmp)->next; @@ -762,7 +762,7 @@ give_cmd(unit * u, order * ord) if (itype!=NULL) { item * i = *i_find(&u->items, itype); if (i!=NULL) { - n = i->number - new_get_resvalue(u, itype->rtype); + n = i->number - get_reservation(u, itype->rtype); give_item(n, itype, u, u2, ord); return; } diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index 763199afe..5362c6543 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -76,14 +76,14 @@ static void reduce_weight(unit * u) { - int horses = new_get_resource(u, oldresourcetype[R_HORSE]); + int horses = get_resource(u, oldresourcetype[R_HORSE]); int capacity = walkingcapacity(u); item ** itmp = &u->items; int weight = 0; if (horses > 0) { horses = min(horses, (u->number*2)); - new_change_resource(u, oldresourcetype[R_HORSE], - horses); + change_resource(u, oldresourcetype[R_HORSE], - horses); } /* 1. get rid of anything that isn't silver or really lightweight or helpful in combat */ diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index 7489bc381..80f64266c 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -446,7 +446,7 @@ destroy_cmd(unit * u, struct order * ord) const requirement * rq = con->materials+c; int recycle = (int)(rq->recycle * rq->number * size/con->reqsize); if (recycle) - new_change_resource(u, rq->rtype, recycle); + change_resource(u, rq->rtype, recycle); } } #endif diff --git a/src/common/kernel/give.c b/src/common/kernel/give.c index 4cf9acebf..4323696dc 100644 --- a/src/common/kernel/give.c +++ b/src/common/kernel/give.c @@ -117,10 +117,10 @@ give_item(int want, const item_type * itype, unit * src, unit * dest, struct ord i_change(&dest->items, itype, n); #ifdef RESERVE_GIVE #ifdef RESERVE_DONATIONS - new_change_resvalue(dest, item2resource(itype), n); + change_reservation(dest, item2resource(itype), n); #else if (src->faction==dest->faction) { - new_change_resvalue(dest, item2resource(itype), n); + change_reservation(dest, item2resource(itype), n); } #endif #endif diff --git a/src/common/kernel/karma.c b/src/common/kernel/karma.c index 7ab94fe9f..d0cca9792 100644 --- a/src/common/kernel/karma.c +++ b/src/common/kernel/karma.c @@ -386,7 +386,7 @@ sacrifice_cmd(unit * u, struct order * ord) cmistake(u, ord, 51, MSG_EVENT); return 0; } - new_change_resource(u, oldresourcetype[R_SILVER], n); + change_resource(u, oldresourcetype[R_SILVER], n); karma = n/10000; u->faction->karma += karma; break; diff --git a/src/common/kernel/pool.c b/src/common/kernel/pool.c index d49f7013f..4b88cee7b 100644 --- a/src/common/kernel/pool.c +++ b/src/common/kernel/pool.c @@ -57,7 +57,7 @@ init_static(void) } int -new_get_resource(const unit * u, const resource_type * rtype) +get_resource(const unit * u, const resource_type * rtype) { const item_type * itype = resource2item(rtype); @@ -91,7 +91,7 @@ new_get_resource(const unit * u, const resource_type * rtype) } int -new_change_resource(unit * u, const resource_type * rtype, int change) +change_resource(unit * u, const resource_type * rtype, int change) { int i = 0; @@ -116,7 +116,7 @@ new_change_resource(unit * u, const resource_type * rtype, int change) } int -new_get_resvalue(const unit * u, const resource_type * rtype) +get_reservation(const unit * u, const resource_type * rtype) { struct reservation * res = u->reservations; @@ -132,7 +132,7 @@ new_get_resvalue(const unit * u, const resource_type * rtype) } int -new_change_resvalue(unit * u, const resource_type * rtype, int value) +change_reservation(unit * u, const resource_type * rtype, int value) { struct reservation *res, ** rp = &u->reservations; @@ -183,7 +183,7 @@ new_get_pooled(const unit * u, const resource_type * rtype, int mode) unit *v; int use = 0; region * r = u->region; - int have = new_get_resource(u, rtype); + int have = get_resource(u, rtype); if ((u->race->ec_flags & GETITEM) == 0) { mode &= (GET_SLACK|GET_RESERVE); @@ -191,7 +191,7 @@ new_get_pooled(const unit * u, const resource_type * rtype, int mode) if ((mode & GET_SLACK) && (mode & GET_RESERVE)) use = have; else { - int reserve = new_get_resvalue(u, rtype); + int reserve = get_reservation(u, rtype); int slack = max(0, have-reserve); if (mode & GET_RESERVE) use = have-slack; else if (mode & GET_SLACK) use = slack; @@ -226,7 +226,7 @@ new_use_pooled(unit * u, const resource_type * rtype, int mode, int count) unit *v; int use = count; region * r = u->region; - int n = 0, have = new_get_resource(u, rtype); + int n = 0, have = get_resource(u, rtype); if ((u->race->ec_flags & GETITEM) == 0) { mode &= (GET_SLACK|GET_RESERVE); @@ -235,19 +235,19 @@ new_use_pooled(unit * u, const resource_type * rtype, int mode, int count) if ((mode & GET_SLACK) && (mode & GET_RESERVE)) { n = min(use, have); } else { - int reserve = new_get_resvalue(u, rtype); + int reserve = get_reservation(u, rtype); int slack = max(0, have-reserve); if (mode & GET_RESERVE) { n = have-slack; n = min(use, n); - new_change_resvalue(u, rtype, -n); + change_reservation(u, rtype, -n); } else if (mode & GET_SLACK) { n = min(use, slack); } } if (n>0) { - new_change_resource(u, rtype, -n); + change_resource(u, rtype, -n); use -= n; } @@ -298,7 +298,7 @@ init_pool(void) use = new_use_pooled(u, rtype, GET_DEFAULT, count); if (use) { new_set_resvalue(u, rtype, use); - new_change_resource(u, rtype, use); + change_resource(u, rtype, use); } } } diff --git a/src/common/kernel/pool.h b/src/common/kernel/pool.h index a03aa895e..e016c39e9 100644 --- a/src/common/kernel/pool.h +++ b/src/common/kernel/pool.h @@ -40,11 +40,11 @@ int new_use_pooled(struct unit * u, const struct resource_type * res, int mode, * von der Einheit reservierten Resourcen */ -int new_get_resource(const struct unit * u, const struct resource_type * res); -int new_change_resource(struct unit * u, const struct resource_type * res, int change); +int get_resource(const struct unit * u, const struct resource_type * res); +int change_resource(struct unit * u, const struct resource_type * res, int change); -int new_get_resvalue(const struct unit * u, const struct resource_type * res); -int new_change_resvalue(struct unit * u, const struct resource_type * res, int value); +int get_reservation(const struct unit * u, const struct resource_type * res); +int change_reservation(struct unit * u, const struct resource_type * res, int value); void init_pool(void);