(navi, march): Simplify convoluted logic. Old code tried path finding
whenever the next direction in the path string is bad. It then passed the whole path string to shp_path(), which makes no sense unless we're at the beginning of it, but luckily failed in that case. Change to try path finding right after prompting for new input.
This commit is contained in:
parent
b63c69ef20
commit
bd51dea51a
2 changed files with 4 additions and 4 deletions
|
@ -112,6 +112,8 @@ march(void)
|
|||
stopping = 1;
|
||||
continue;
|
||||
}
|
||||
if (cp && !(cp = lnd_path(together, lnd, buf)))
|
||||
cp = buf;
|
||||
}
|
||||
if (cp == 0 || *cp == '\0')
|
||||
cp = &dirch[DIR_STOP];
|
||||
|
@ -160,8 +162,6 @@ march(void)
|
|||
} else {
|
||||
dir = chkdir(*cp++, DIR_STOP, DIR_LAST);
|
||||
if (dir < 0) {
|
||||
if (NULL != (cp = lnd_path(together, lnd, buf)))
|
||||
continue;
|
||||
direrr("`%c' to stop", 0, 0);
|
||||
pr(", `i' to list units, `f' to change leader,\n");
|
||||
pr("`r' to radar, `l' to look, `M' to map, `B' to bmap,\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue