- Fix Route/Pause

This commit is contained in:
Christian Schlittchen 2001-02-18 12:20:37 +00:00
parent 40a5f0a742
commit f19b1a1419
3 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: eressea.c,v 1.17 2001/02/18 08:37:57 enno Exp $ * $Id: eressea.c,v 1.18 2001/02/18 12:20:37 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -1034,7 +1034,7 @@ igetstrtoken (const char *s1)
{ {
int i; int i;
static const char *s; static const char *s;
static char buf[DISPLAYSIZE + 1]; static char lbuf[DISPLAYSIZE + 1];
if (s1) s = s1; if (s1) s = s1;
while (*s == ' ') while (*s == ' ')
@ -1042,7 +1042,7 @@ igetstrtoken (const char *s1)
i = 0; i = 0;
while (*s && *s != ' ' && i < DISPLAYSIZE) { while (*s && *s != ' ' && i < DISPLAYSIZE) {
buf[i] = (*s); lbuf[i] = (*s);
/* Hier wird space_replacement wieder in space zurueck /* Hier wird space_replacement wieder in space zurueck
* verwandelt, ausser wenn es nach einem escape_char kommt. Im * verwandelt, ausser wenn es nach einem escape_char kommt. Im
@ -1050,17 +1050,17 @@ igetstrtoken (const char *s1)
* ersetzt, statt den aktuellen char einfach dran zu haengen. */ * ersetzt, statt den aktuellen char einfach dran zu haengen. */
if (*s == SPACE_REPLACEMENT) { if (*s == SPACE_REPLACEMENT) {
if (i > 0 && buf[i - 1] == ESCAPE_CHAR) if (i > 0 && lbuf[i - 1] == ESCAPE_CHAR)
buf[--i] = SPACE_REPLACEMENT; lbuf[--i] = SPACE_REPLACEMENT;
else else
buf[i] = SPACE; lbuf[i] = SPACE;
} }
i++; i++;
s++; s++;
} }
buf[i] = 0; lbuf[i] = 0;
return buf; return lbuf;
} }
char * char *
@ -2129,6 +2129,7 @@ init_directions(tnode * root)
{ "südwesten", D_SOUTHWEST}, { "südwesten", D_SOUTHWEST},
{ "osten", D_EAST }, { "osten", D_EAST },
{ "westen",D_WEST }, { "westen",D_WEST },
{ "pause", D_PAUSE },
{ NULL, NODIRECTION} { NULL, NODIRECTION}
}; };
int i; int i;
@ -2416,9 +2417,11 @@ movewhere(region * r, const unit *u)
region * r2; region * r2;
token = getstrtoken(); token = getstrtoken();
if(findparam(token) == P_PAUSE) return r;
d = finddirection(token); d = finddirection(token);
if (d == D_PAUSE)
return r;
if (d == NODIRECTION) if (d == NODIRECTION)
return findspecialdirection(r, token); return findspecialdirection(r, token);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: movement.c,v 1.11 2001/02/18 10:06:09 enno Exp $ * $Id: movement.c,v 1.12 2001/02/18 12:20:37 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -740,11 +740,11 @@ cycle_route(unit *u, int gereist)
for (cm=0;;++cm) { for (cm=0;;++cm) {
pause = false; pause = false;
token = getstrtoken(); token = getstrtoken();
if(findparam(token) == P_PAUSE) {
pause = true;
} else {
d = finddirection(token); d = finddirection(token);
if (d==NODIRECTION) break; if(d == D_PAUSE) {
pause = true;
} else if (d==NODIRECTION) {
break;
} }
if (cm<gereist) { if (cm<gereist) {
/* hier sollte keine PAUSE auftreten */ /* hier sollte keine PAUSE auftreten */

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: mapper.c,v 1.12 2001/02/11 08:55:48 corwin Exp $ * $Id: mapper.c,v 1.13 2001/02/18 12:20:37 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -56,7 +56,7 @@ char datafile[256];
short Signals = 0; short Signals = 0;
unit *clipunit; unit *clipunit;
ship *clipship; struct ship *clipship;
region *clipregion; region *clipregion;
tagregion *Tagged; tagregion *Tagged;