fix a serious issue where repeated orders were getting lost

This commit is contained in:
Enno Rehling 2012-05-18 23:57:20 -07:00
parent b95f7ec139
commit 504a70a9c6
1 changed files with 29 additions and 26 deletions

View File

@ -291,41 +291,44 @@ static unit *unitorders(FILE * F, int enc, struct faction *f)
if (s == NULL) if (s == NULL)
break; break;
if (s[0] && s[0]!='@') { if (s[0]) {
const char *stok = s; if (s[0]!='@') {
stok = parse_token(&stok); const char *stok = s;
stok = parse_token(&stok);
if (stok) { if (stok) {
boolean quit = false; boolean quit = false;
param_t param = findparam(stok, u->faction->locale); param_t param = findparam(stok, u->faction->locale);
switch (param) { switch (param) {
case P_UNIT: case P_UNIT:
case P_REGION: case P_REGION:
quit = true;
break;
case P_FACTION:
case P_NEXT:
case P_GAMENAME:
/* these terminate the orders, so we apply extra checking */
if (strlen(stok) >= 3) {
quit = true; quit = true;
break; break;
} else { case P_FACTION:
quit = false; case P_NEXT:
case P_GAMENAME:
/* these terminate the orders, so we apply extra checking */
if (strlen(stok) >= 3) {
quit = true;
break;
} else {
quit = false;
}
break;
default:
/* TODO: syntax error message */
break;
}
if (quit) {
break;
} }
break;
default:
/* TODO: syntax error message */
break;
}
if (quit) {
break;
} }
} }
/* Nun wird der Befehl erzeut und eingehängt */ /* Nun wird der Befehl erzeut und eingehängt */
*ordp = parse_order(s, u->faction->locale); *ordp = parse_order(s, u->faction->locale);
if (*ordp) if (*ordp) {
ordp = &(*ordp)->next; ordp = &(*ordp)->next;
}
} }
} }