Merge pull request #635 from ennorehling/develop

FACTION and PARTEI should both start orders.
This commit is contained in:
Enno Rehling 2017-01-23 09:47:46 +01:00 committed by GitHub
commit ed3667130e
2 changed files with 25 additions and 4 deletions

View File

@ -252,6 +252,26 @@ static faction *factionorders(void)
return f; return f;
} }
static param_t next_param(const char *s, const struct locale *lang) {
param_t p;
if (!s || s[0] == '@') {
return NOPARAM;
}
p = findparam(s, lang);
if (p==NOPARAM) {
const struct locale *loc;
for (loc=locales;loc;loc=nextlocale(loc)) {
if (loc!=lang) {
p = findparam(s, lang);
if (p==P_FACTION || p==P_GAMENAME) {
break;
}
}
}
}
return p;
}
int readorders(const char *filename) int readorders(const char *filename)
{ {
FILE *F = NULL; FILE *F = NULL;
@ -279,7 +299,7 @@ int readorders(const char *filename)
const char *s; const char *s;
init_tokens_str(b); init_tokens_str(b);
s = gettoken(token, sizeof(token)); s = gettoken(token, sizeof(token));
p = (s && s[0] != '@') ? findparam(s, lang) : NOPARAM; p = next_param(s, lang);
switch (p) { switch (p) {
case P_GAMENAME: case P_GAMENAME:
case P_FACTION: case P_FACTION:
@ -308,7 +328,7 @@ int readorders(const char *filename)
p = (s && s[0] != '@') ? findparam(s, lang) : NOPARAM; p = (s && s[0] != '@') ? findparam(s, lang) : NOPARAM;
} while ((p != P_UNIT || !f) && p != P_FACTION && p != P_NEXT } while ((p != P_UNIT || !f) && p != P_FACTION && p != P_NEXT
&& p != P_GAMENAME); && p != P_GAMENAME);
} }
break; break;
/* Falls in unitorders() abgebrochen wird, steht dort entweder eine neue /* Falls in unitorders() abgebrochen wird, steht dort entweder eine neue

View File

@ -1,4 +1,4 @@
ERESSEA 6rLo "6rLo" PARTEI 6rLo "6rLo"
EINHEIT 7Lgf EINHEIT 7Lgf
NACH NW NW NACH NW NW
NAECHSTER NAECHSTER
@ -6,7 +6,8 @@ ERESSEA w86y "w86y"
EINHEIT uc3u EINHEIT uc3u
STIRB "mrqa" STIRB "mrqa"
NAECHSTER NAECHSTER
ERESSEA ngij "ngij"
FACTION ngij "ngij"
EINHEIT iwbz EINHEIT iwbz
HELFE w86y ALLES HELFE w86y ALLES
EINHEIT j536 EINHEIT j536