diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 2990a8340..a664f821c 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -504,7 +504,7 @@ addgive(unit * u, unit * u2, int n, resource_t res, const char * cmd, int error) /* Derzeit fallen nur Silber und Pferde an die Region * */ - void +void give_peasants(int n, const item_type * itype, unit * src) { region *r = src->region; diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index e0b8605fd..18da9af0d 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -613,6 +613,19 @@ rmoney(const region * r) return ((r)->land?(r)->land->money:0); } +void +rsethorses(region *r, int value) +{ + assert(r->land != NULL && value >= 0); + r->land->horses = value; +} + +int +rhorses(region *r) +{ + return r->land?r->land->horses:0; +} + void rsetmoney(region * r, int value) { diff --git a/src/common/kernel/region.h b/src/common/kernel/region.h index e3860112c..d53b7d26b 100644 --- a/src/common/kernel/region.h +++ b/src/common/kernel/region.h @@ -171,9 +171,8 @@ int rpeasants(const struct region * r); void rsetpeasants(struct region * r, int value); int rmoney(const struct region * r); void rsetmoney(struct region * r, int value); - -#define rhorses(r) ((r)->land?(r)->land->horses:0) -#define rsethorses(r, value) ((r)->land?((r)->land->horses=(value)):(assert((value)>=0), (value)),0) +int rhorses(struct region * r); +void rsethorses(struct region * r, int value); #define rbuildings(r) ((r)->buildings)