persistente befehle nur noch mit @

This commit is contained in:
Enno Rehling 2002-05-02 21:19:45 +00:00
parent 2171245196
commit 03a967c2c4
2 changed files with 61 additions and 26 deletions

View File

@ -610,12 +610,8 @@ is_persistent(const char *s, const struct locale *lang)
if(*s == '@') return true; if(*s == '@') return true;
#endif /* Nur kurze Befehle! */ #endif /* Nur kurze Befehle! */
switch(igetkeyword(s, lang)) { switch(igetkeyword(s, lang)) {
case K_BUY:
case K_SELL:
case K_CAST:
case K_KOMMENTAR: case K_KOMMENTAR:
case K_LIEFERE: case K_LIEFERE:
case K_RESERVE:
return true; return true;
break; break;
} }

View File

@ -83,6 +83,44 @@
extern void reorder_owners(struct region * r); extern void reorder_owners(struct region * r);
static int
convert_orders(void)
{
region * r;
for (r=regions;r;r=r->next) {
unit * u;
for (u=r->units;u;u=u->next) {
strlist * o;
for (o=u->orders;o;o=o->next) {
int c = igetkeyword(o->s, u->faction->locale);
switch (c) {
case K_RESERVE:
case K_BUY:
case K_SELL:
case K_CAST:
sprintf(buf, "@%s", LOC(u->faction->locale, keywords[c]));
for (;;) {
const char * c = getstrtoken();
if (c && *c) {
if (strchr(c, ' ')) {
strcat(buf, " \"");
strcat(buf, c);
strcat(buf, "\"");
} else {
strcat(buf, " ");
strcat(buf, c);
}
} else break;
}
set_string(&o->s, buf);
break;
}
}
}
}
return 0;
}
static void static void
verify_owners(boolean bOnce) verify_owners(boolean bOnce)
{ {
@ -2828,6 +2866,7 @@ korrektur(void)
update_gmquests(); /* test gm quests */ update_gmquests(); /* test gm quests */
/* fix_unitrefs(); */ /* fix_unitrefs(); */
stats(); stats();
do_once("pers", convert_orders());
do_once("sql2", dump_sql()); do_once("sql2", dump_sql());
do_once("fw02", fix_watchers()); do_once("fw02", fix_watchers());
do_once("fxh3", fix_plainherbs()); do_once("fxh3", fix_plainherbs());