diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 3716a8a54..733dcbf3d 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -292,7 +292,6 @@ const char *keywords[MAXKEYWORDS] = "MACHEN", "NACH", "PASSWORT", - "REGION", "REKRUTIEREN", "RESERVIEREN", "ROUTE", @@ -1264,6 +1263,7 @@ parse(keyword_t kword, int (*dofun)(unit *, struct order *), boolean thisorder) order * ord = *ordp; if (get_keyword(ord) == kword) { if (dofun(u, ord)!=0) break; + if (u->orders==NULL) break; } if (thisorder) break; if (*ordp==ord) ordp=&ord->next; diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index a99189669..d55f024fe 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -412,7 +412,6 @@ enum { K_MAKE, K_MOVE, K_PASSWORD, - K_DUMMY, K_RECRUIT, K_RESERVE, K_ROUTE, diff --git a/src/common/kernel/order.c b/src/common/kernel/order.c index 48f61527c..fc48c6be7 100644 --- a/src/common/kernel/order.c +++ b/src/common/kernel/order.c @@ -161,11 +161,9 @@ write_order(const order * ord, const struct locale * lang, char * buffer, size_t if (ord==0 || ord->_keyword==NOKEYWORD) { buffer[0]=0; } else { -#ifndef NDEBUG - const char * s = cmd->_str; - assert(findkeyword(parse_token(&s), lang)==cmd->_keyword); -#endif - strncpy(buffer, cmd->_str, size); + char * s = getcommand(ord); + strncpy(buffer, s, size); + free(s); } return buffer; } diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index bba8a2ccb..c219124ea 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -491,6 +491,7 @@ unitorders(FILE * F, struct faction * f) boolean quit = false; switch (findparam(s, u->faction->locale)) { case P_UNIT: + case P_REGION: case P_FACTION: case P_NEXT: case P_GAMENAME: @@ -1201,8 +1202,9 @@ writeunit(FILE * F, const unit * u) wi(F, u->flags & UFL_SAVEMASK); wnl(F); for (ord = u->orders; ord; ord=ord->next) { - if (is_persistent(ord) && get_keyword(ord)!=NOKEYWORD) { - writeorder(ord, u->faction->locale, F); + if (is_persistent(ord)) { + writeorder(ord, u->faction->locale, F); + } } ws(F, ""); /* Abschluß der persistenten Befehle */ writeorder(u->lastorder, u->faction->locale, F);