Der letzte commit war etwas verfüht...

This commit is contained in:
Enno Rehling 2004-06-26 21:03:42 +00:00
parent 612cb54ed9
commit f1f23e3ff3
4 changed files with 8 additions and 9 deletions

View File

@ -292,7 +292,6 @@ const char *keywords[MAXKEYWORDS] =
"MACHEN", "MACHEN",
"NACH", "NACH",
"PASSWORT", "PASSWORT",
"REGION",
"REKRUTIEREN", "REKRUTIEREN",
"RESERVIEREN", "RESERVIEREN",
"ROUTE", "ROUTE",
@ -1264,6 +1263,7 @@ parse(keyword_t kword, int (*dofun)(unit *, struct order *), boolean thisorder)
order * ord = *ordp; order * ord = *ordp;
if (get_keyword(ord) == kword) { if (get_keyword(ord) == kword) {
if (dofun(u, ord)!=0) break; if (dofun(u, ord)!=0) break;
if (u->orders==NULL) break;
} }
if (thisorder) break; if (thisorder) break;
if (*ordp==ord) ordp=&ord->next; if (*ordp==ord) ordp=&ord->next;

View File

@ -412,7 +412,6 @@ enum {
K_MAKE, K_MAKE,
K_MOVE, K_MOVE,
K_PASSWORD, K_PASSWORD,
K_DUMMY,
K_RECRUIT, K_RECRUIT,
K_RESERVE, K_RESERVE,
K_ROUTE, K_ROUTE,

View File

@ -161,11 +161,9 @@ write_order(const order * ord, const struct locale * lang, char * buffer, size_t
if (ord==0 || ord->_keyword==NOKEYWORD) { if (ord==0 || ord->_keyword==NOKEYWORD) {
buffer[0]=0; buffer[0]=0;
} else { } else {
#ifndef NDEBUG char * s = getcommand(ord);
const char * s = cmd->_str; strncpy(buffer, s, size);
assert(findkeyword(parse_token(&s), lang)==cmd->_keyword); free(s);
#endif
strncpy(buffer, cmd->_str, size);
} }
return buffer; return buffer;
} }

View File

@ -491,6 +491,7 @@ unitorders(FILE * F, struct faction * f)
boolean quit = false; boolean quit = false;
switch (findparam(s, u->faction->locale)) { switch (findparam(s, u->faction->locale)) {
case P_UNIT: case P_UNIT:
case P_REGION:
case P_FACTION: case P_FACTION:
case P_NEXT: case P_NEXT:
case P_GAMENAME: case P_GAMENAME:
@ -1201,9 +1202,10 @@ writeunit(FILE * F, const unit * u)
wi(F, u->flags & UFL_SAVEMASK); wi(F, u->flags & UFL_SAVEMASK);
wnl(F); wnl(F);
for (ord = u->orders; ord; ord=ord->next) { for (ord = u->orders; ord; ord=ord->next) {
if (is_persistent(ord) && get_keyword(ord)!=NOKEYWORD) { if (is_persistent(ord)) {
writeorder(ord, u->faction->locale, F); writeorder(ord, u->faction->locale, F);
} }
}
ws(F, ""); /* Abschluß der persistenten Befehle */ ws(F, ""); /* Abschluß der persistenten Befehle */
writeorder(u->lastorder, u->faction->locale, F); writeorder(u->lastorder, u->faction->locale, F);
wnl(F); wnl(F);