forked from github/server
parent
3cd47bb8fa
commit
fc73da4ae4
51
src/move.c
51
src/move.c
|
@ -2189,7 +2189,7 @@ static const region_list *travel_i(unit * u, const region_list * route_begin,
|
||||||
static void travel(unit * u, region_list ** routep)
|
static void travel(unit * u, region_list ** routep)
|
||||||
{
|
{
|
||||||
region *r = u->region;
|
region *r = u->region;
|
||||||
region_list *route_begin = NULL;
|
region_list *route_begin;
|
||||||
follower *followers = NULL;
|
follower *followers = NULL;
|
||||||
|
|
||||||
assert(routep);
|
assert(routep);
|
||||||
|
@ -2232,36 +2232,37 @@ static void travel(unit * u, region_list ** routep)
|
||||||
make_route(u, u->thisorder, routep);
|
make_route(u, u->thisorder, routep);
|
||||||
route_begin = *routep;
|
route_begin = *routep;
|
||||||
|
|
||||||
/* und ab die post: */
|
if (route_begin) {
|
||||||
travel_i(u, route_begin, NULL, u->thisorder, TRAVEL_NORMAL, &followers);
|
/* und ab die post: */
|
||||||
|
travel_i(u, route_begin, NULL, u->thisorder, TRAVEL_NORMAL, &followers);
|
||||||
|
|
||||||
/* followers */
|
/* followers */
|
||||||
while (followers != NULL) {
|
while (followers != NULL) {
|
||||||
follower *fnext = followers->next;
|
follower *fnext = followers->next;
|
||||||
unit *uf = followers->uf;
|
unit *uf = followers->uf;
|
||||||
unit *ut = followers->ut;
|
unit *ut = followers->ut;
|
||||||
const region_list *route_end = followers->route_end;
|
const region_list *route_end = followers->route_end;
|
||||||
|
|
||||||
free(followers);
|
free(followers);
|
||||||
followers = fnext;
|
followers = fnext;
|
||||||
|
|
||||||
if (uf->region == r) {
|
if (uf->region == r) {
|
||||||
order *follow_order;
|
order *follow_order;
|
||||||
const struct locale *lang = u->faction->locale;
|
const struct locale *lang = u->faction->locale;
|
||||||
const char *s = LOC(uf->faction->locale, parameters[P_UNIT]);
|
const char *s = LOC(uf->faction->locale, parameters[P_UNIT]);
|
||||||
/* construct an order */
|
/* construct an order */
|
||||||
assert(s || !"missing translation for UNIT keyword");
|
assert(s || !"missing translation for UNIT keyword");
|
||||||
follow_order = create_order(K_FOLLOW, lang, "%s %i",
|
follow_order = create_order(K_FOLLOW, lang, "%s %i",
|
||||||
s, ut->no);
|
s, ut->no);
|
||||||
|
|
||||||
route_end = reroute(uf, route_begin, route_end);
|
route_end = reroute(uf, route_begin, route_end);
|
||||||
travel_i(uf, route_begin, route_end, follow_order, TRAVEL_FOLLOWING,
|
travel_i(uf, route_begin, route_end, follow_order, TRAVEL_FOLLOWING,
|
||||||
&followers);
|
&followers);
|
||||||
caught_target(uf->region, uf);
|
caught_target(uf->region, uf);
|
||||||
free_order(follow_order);
|
free_order(follow_order);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void move_cmd(unit * u, bool move_on_land)
|
void move_cmd(unit * u, bool move_on_land)
|
||||||
|
|
Loading…
Reference in New Issue