eliminate more non-critical arguments.

This commit is contained in:
Enno Rehling 2015-08-27 16:59:39 +02:00
parent 20ab40dc2b
commit e4026e0f6b
3 changed files with 16 additions and 16 deletions

View File

@ -1526,7 +1526,7 @@ int make_cmd(unit * u, struct order *ord)
const char * s = gettoken(token, sizeof(token));
direction_t d = s ? get_direction(s, u->faction->locale) : NODIRECTION;
if (d != NODIRECTION) {
build_road(r, u, m, d);
build_road(u, m, d);
}
else {
/* Die Richtung wurde nicht erkannt */
@ -1541,7 +1541,7 @@ int make_cmd(unit * u, struct order *ord)
cmistake(u, ord, 276, MSG_PRODUCE);
}
else {
continue_ship(r, u, m);
continue_ship(u, m);
}
return 0;
}
@ -1597,7 +1597,7 @@ int make_cmd(unit * u, struct order *ord)
cmistake(u, ord, 276, MSG_PRODUCE);
}
else {
create_ship(r, u, stype, m, ord);
create_ship(u, stype, m, ord);
}
}
else if (btype != NOBUILDING) {
@ -2437,15 +2437,15 @@ static void breedtrees(unit * u, int raw)
}
/* züchte pferde */
static void breedhorses(region * r, unit * u)
static void breedhorses(unit * u)
{
int n, c, breed = 0;
struct building *b = inside_building(u);
const struct building_type *btype = b ? b->type : NULL;
const struct resource_type *rhorse = get_resourcetype(R_HORSE);
int horses, effsk;
assert(rhorse && rhorse->itype);
assert(r == u->region); // TODO: param r is unnecessary
if (btype != bt_find("stables")) {
cmistake(u, u->thisorder, 122, MSG_PRODUCE);
return;
@ -2524,7 +2524,7 @@ static void breed_cmd(unit * u, struct order *ord)
break;
}
}
breedhorses(r, u);
breedhorses(u);
break;
}
}

View File

@ -261,13 +261,13 @@ int destroy_cmd(unit * u, struct order *ord)
/* ------------------------------------------------------------- */
void build_road(region * r, unit * u, int size, direction_t d)
void build_road(unit * u, int size, direction_t d)
{
region *r = u->region;
int n, left, effsk;
region *rn = rconnect(r, d);
assert(u->number);
assert(r == u->region); // TODO: param r is unnecessary
effsk = effskill(u, SK_ROAD_BUILDING, 0);
if (!effsk) {
cmistake(u, u->thisorder, 103, MSG_PRODUCE);
@ -880,15 +880,15 @@ static void build_ship(unit * u, ship * sh, int want)
}
void
create_ship(region * r, unit * u, const struct ship_type *newtype, int want,
create_ship(unit * u, const struct ship_type *newtype, int want,
order * ord)
{
ship *sh;
int msize;
const construction *cons = newtype->construction;
order *new_order;
region * r = u->region;
assert(u->region == r); // TODO: param r is unnecessary
if (!effskill(u, SK_SHIPBUILDING, 0)) {
cmistake(u, ord, 100, MSG_PRODUCE);
return;
@ -931,13 +931,13 @@ order * ord)
build_ship(u, sh, want);
}
void continue_ship(region * r, unit * u, int want)
void continue_ship(unit * u, int want)
{
const construction *cons;
ship *sh;
int msize;
region * r = u->region;
assert(u->region == r); // TODO: param r is unnecessary
if (!effskill(u, SK_SHIPBUILDING, 0)) {
cmistake(u, u->thisorder, 100, MSG_PRODUCE);
return;

View File

@ -68,10 +68,10 @@ extern "C" {
extern int destroy_cmd(struct unit *u, struct order *ord);
extern int leave_cmd(struct unit *u, struct order *ord);
void build_road(struct region *r, struct unit *u, int size, direction_t d);
void create_ship(struct region *r, struct unit *u,
const struct ship_type *newtype, int size, struct order *ord);
void continue_ship(struct region *r, struct unit *u, int size);
void build_road(struct unit *u, int size, direction_t d);
void create_ship(struct unit *u, const struct ship_type *newtype,
int size, struct order *ord);
void continue_ship(struct unit *u, int size);
struct building *getbuilding(const struct region *r);
struct ship *getship(const struct region *r);