forked from github/server
eliminate more non-critical arguments.
This commit is contained in:
parent
20ab40dc2b
commit
e4026e0f6b
|
@ -1526,7 +1526,7 @@ int make_cmd(unit * u, struct order *ord)
|
||||||
const char * s = gettoken(token, sizeof(token));
|
const char * s = gettoken(token, sizeof(token));
|
||||||
direction_t d = s ? get_direction(s, u->faction->locale) : NODIRECTION;
|
direction_t d = s ? get_direction(s, u->faction->locale) : NODIRECTION;
|
||||||
if (d != NODIRECTION) {
|
if (d != NODIRECTION) {
|
||||||
build_road(r, u, m, d);
|
build_road(u, m, d);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Die Richtung wurde nicht erkannt */
|
/* Die Richtung wurde nicht erkannt */
|
||||||
|
@ -1541,7 +1541,7 @@ int make_cmd(unit * u, struct order *ord)
|
||||||
cmistake(u, ord, 276, MSG_PRODUCE);
|
cmistake(u, ord, 276, MSG_PRODUCE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
continue_ship(r, u, m);
|
continue_ship(u, m);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1597,7 +1597,7 @@ int make_cmd(unit * u, struct order *ord)
|
||||||
cmistake(u, ord, 276, MSG_PRODUCE);
|
cmistake(u, ord, 276, MSG_PRODUCE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
create_ship(r, u, stype, m, ord);
|
create_ship(u, stype, m, ord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (btype != NOBUILDING) {
|
else if (btype != NOBUILDING) {
|
||||||
|
@ -2437,15 +2437,15 @@ static void breedtrees(unit * u, int raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* züchte pferde */
|
/* züchte pferde */
|
||||||
static void breedhorses(region * r, unit * u)
|
static void breedhorses(unit * u)
|
||||||
{
|
{
|
||||||
int n, c, breed = 0;
|
int n, c, breed = 0;
|
||||||
struct building *b = inside_building(u);
|
struct building *b = inside_building(u);
|
||||||
const struct building_type *btype = b ? b->type : NULL;
|
const struct building_type *btype = b ? b->type : NULL;
|
||||||
const struct resource_type *rhorse = get_resourcetype(R_HORSE);
|
const struct resource_type *rhorse = get_resourcetype(R_HORSE);
|
||||||
int horses, effsk;
|
int horses, effsk;
|
||||||
|
|
||||||
assert(rhorse && rhorse->itype);
|
assert(rhorse && rhorse->itype);
|
||||||
assert(r == u->region); // TODO: param r is unnecessary
|
|
||||||
if (btype != bt_find("stables")) {
|
if (btype != bt_find("stables")) {
|
||||||
cmistake(u, u->thisorder, 122, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 122, MSG_PRODUCE);
|
||||||
return;
|
return;
|
||||||
|
@ -2524,7 +2524,7 @@ static void breed_cmd(unit * u, struct order *ord)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
breedhorses(r, u);
|
breedhorses(u);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
int n, left, effsk;
|
||||||
region *rn = rconnect(r, d);
|
region *rn = rconnect(r, d);
|
||||||
|
|
||||||
assert(u->number);
|
assert(u->number);
|
||||||
assert(r == u->region); // TODO: param r is unnecessary
|
|
||||||
effsk = effskill(u, SK_ROAD_BUILDING, 0);
|
effsk = effskill(u, SK_ROAD_BUILDING, 0);
|
||||||
if (!effsk) {
|
if (!effsk) {
|
||||||
cmistake(u, u->thisorder, 103, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 103, MSG_PRODUCE);
|
||||||
|
@ -880,15 +880,15 @@ static void build_ship(unit * u, ship * sh, int want)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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)
|
order * ord)
|
||||||
{
|
{
|
||||||
ship *sh;
|
ship *sh;
|
||||||
int msize;
|
int msize;
|
||||||
const construction *cons = newtype->construction;
|
const construction *cons = newtype->construction;
|
||||||
order *new_order;
|
order *new_order;
|
||||||
|
region * r = u->region;
|
||||||
|
|
||||||
assert(u->region == r); // TODO: param r is unnecessary
|
|
||||||
if (!effskill(u, SK_SHIPBUILDING, 0)) {
|
if (!effskill(u, SK_SHIPBUILDING, 0)) {
|
||||||
cmistake(u, ord, 100, MSG_PRODUCE);
|
cmistake(u, ord, 100, MSG_PRODUCE);
|
||||||
return;
|
return;
|
||||||
|
@ -931,13 +931,13 @@ order * ord)
|
||||||
build_ship(u, sh, want);
|
build_ship(u, sh, want);
|
||||||
}
|
}
|
||||||
|
|
||||||
void continue_ship(region * r, unit * u, int want)
|
void continue_ship(unit * u, int want)
|
||||||
{
|
{
|
||||||
const construction *cons;
|
const construction *cons;
|
||||||
ship *sh;
|
ship *sh;
|
||||||
int msize;
|
int msize;
|
||||||
|
region * r = u->region;
|
||||||
|
|
||||||
assert(u->region == r); // TODO: param r is unnecessary
|
|
||||||
if (!effskill(u, SK_SHIPBUILDING, 0)) {
|
if (!effskill(u, SK_SHIPBUILDING, 0)) {
|
||||||
cmistake(u, u->thisorder, 100, MSG_PRODUCE);
|
cmistake(u, u->thisorder, 100, MSG_PRODUCE);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -68,10 +68,10 @@ extern "C" {
|
||||||
extern int destroy_cmd(struct unit *u, struct order *ord);
|
extern int destroy_cmd(struct unit *u, struct order *ord);
|
||||||
extern int leave_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 build_road(struct unit *u, int size, direction_t d);
|
||||||
void create_ship(struct region *r, struct unit *u,
|
void create_ship(struct unit *u, const struct ship_type *newtype,
|
||||||
const struct ship_type *newtype, int size, struct order *ord);
|
int size, struct order *ord);
|
||||||
void continue_ship(struct region *r, struct unit *u, int size);
|
void continue_ship(struct unit *u, int size);
|
||||||
|
|
||||||
struct building *getbuilding(const struct region *r);
|
struct building *getbuilding(const struct region *r);
|
||||||
struct ship *getship(const struct region *r);
|
struct ship *getship(const struct region *r);
|
||||||
|
|
Loading…
Reference in New Issue