forked from github/server
Keine Beschwerden über trailing spaces bei NACH/ROUTE
This commit is contained in:
parent
f9826a2674
commit
9f92b2e525
|
@ -2891,11 +2891,16 @@ movement_error(unit * u, const char * token, order * ord, int error_code)
|
||||||
int
|
int
|
||||||
movewhere(const unit *u, const char * token, region * r, region** resultp)
|
movewhere(const unit *u, const char * token, region * r, region** resultp)
|
||||||
{
|
{
|
||||||
direction_t d = finddirection(token, u->faction->locale);
|
|
||||||
region * r2;
|
region * r2;
|
||||||
|
direction_t d;
|
||||||
|
|
||||||
|
if (*token == '\0') {
|
||||||
|
*resultp = NULL;
|
||||||
|
return E_MOVE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
d = finddirection(token, u->faction->locale);
|
||||||
switch (d) {
|
switch (d) {
|
||||||
|
|
||||||
case D_PAUSE:
|
case D_PAUSE:
|
||||||
*resultp = r;
|
*resultp = r;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1082,20 +1082,14 @@ make_route(unit * u, order * ord, region_list ** routep)
|
||||||
|
|
||||||
current = next;
|
current = next;
|
||||||
token = getstrtoken();
|
token = getstrtoken();
|
||||||
if (token[0]) {
|
error = movewhere(u, token, current, &next);
|
||||||
error = movewhere(u, token, current, &next);
|
if (error) {
|
||||||
if (error) {
|
message * msg = movement_error(u, token, ord, error);
|
||||||
message * msg = movement_error(u, token, ord, error);
|
if (msg!=NULL) {
|
||||||
if (msg!=NULL) {
|
add_message(&u->faction->msgs, msg);
|
||||||
add_message(&u->faction->msgs, msg);
|
msg_release(msg);
|
||||||
msg_release(msg);
|
|
||||||
}
|
|
||||||
next = NULL;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
next = NULL;
|
next = NULL;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1478,7 +1472,7 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
||||||
* Durchlauf schon gesetzt (Parameter!). current_point ist die letzte gültige,
|
* Durchlauf schon gesetzt (Parameter!). current_point ist die letzte gültige,
|
||||||
* befahrene Region. */
|
* befahrene Region. */
|
||||||
|
|
||||||
while (current_point!=next_point && step < k && next_point) {
|
while (next_point && current_point!=next_point && step < k) {
|
||||||
const char * token;
|
const char * token;
|
||||||
int error;
|
int error;
|
||||||
terrain_t tthis = rterrain(current_point);
|
terrain_t tthis = rterrain(current_point);
|
||||||
|
@ -1624,13 +1618,13 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
||||||
if (rterrain(current_point) != T_OCEAN && !is_cursed(sh->attribs, C_SHIP_FLYING, 0)) break;
|
if (rterrain(current_point) != T_OCEAN && !is_cursed(sh->attribs, C_SHIP_FLYING, 0)) break;
|
||||||
token = getstrtoken();
|
token = getstrtoken();
|
||||||
error = movewhere(u, token, current_point, &next_point);
|
error = movewhere(u, token, current_point, &next_point);
|
||||||
if (error) {
|
if (error || next_point==NULL) {
|
||||||
message * msg = movement_error(u, token, ord, error);
|
message * msg = movement_error(u, token, ord, error);
|
||||||
if (msg!=NULL) {
|
if (msg!=NULL) {
|
||||||
add_message(&u->faction->msgs, msg);
|
add_message(&u->faction->msgs, msg);
|
||||||
msg_release(msg);
|
msg_release(msg);
|
||||||
}
|
}
|
||||||
next_point=current_point;
|
next_point = current_point;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue