- rhorses/sethorses reguläre Funktion. Besseres Debugging.

This commit is contained in:
Christian Schlittchen 2002-04-28 07:53:07 +00:00
parent b682917dd1
commit aa619ea977
3 changed files with 16 additions and 4 deletions

View File

@ -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 /* Derzeit fallen nur Silber und Pferde an die Region
* */ * */
void void
give_peasants(int n, const item_type * itype, unit * src) give_peasants(int n, const item_type * itype, unit * src)
{ {
region *r = src->region; region *r = src->region;

View File

@ -613,6 +613,19 @@ rmoney(const region * r)
return ((r)->land?(r)->land->money:0); 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 void
rsetmoney(region * r, int value) rsetmoney(region * r, int value)
{ {

View File

@ -171,9 +171,8 @@ int rpeasants(const struct region * r);
void rsetpeasants(struct region * r, int value); void rsetpeasants(struct region * r, int value);
int rmoney(const struct region * r); int rmoney(const struct region * r);
void rsetmoney(struct region * r, int value); void rsetmoney(struct region * r, int value);
int rhorses(struct region * r);
#define rhorses(r) ((r)->land?(r)->land->horses:0) void rsethorses(struct region * r, int value);
#define rsethorses(r, value) ((r)->land?((r)->land->horses=(value)):(assert((value)>=0), (value)),0)
#define rbuildings(r) ((r)->buildings) #define rbuildings(r) ((r)->buildings)