From f1f23e3ff35d002f41c7b219689f0333629611a7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 26 Jun 2004 21:03:42 +0000 Subject: [PATCH] =?UTF-8?q?Der=20letzte=20commit=20war=20etwas=20verf?= =?UTF-8?q?=C3=BCht...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/eressea.c | 2 +- src/common/kernel/eressea.h | 1 - src/common/kernel/order.c | 8 +++----- src/common/kernel/save.c | 6 ++++-- 4 files changed, 8 insertions(+), 9 deletions(-) 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);