(player_coms, best): bestdistpath' and
bestpath' violate the rule
that commands must be unique within the first four letters. best() implements both. It calls BestDistPath() for the former, and BestLandPath() for the latter. However, BestDistPath() is just a wrapper around BestLandPath(); it does exactly the same. Drop `bestdistpath'.
This commit is contained in:
parent
c16179eeae
commit
92fcbc22a7
4 changed files with 3 additions and 45 deletions
|
@ -51,11 +51,8 @@ best(void)
|
|||
s_char *BestDistPath(), *BestLandPath(), *s;
|
||||
struct sctstr s1, s2;
|
||||
struct nstr_sect nstr, nstr2;
|
||||
int dist = 0;
|
||||
s_char buf[1024];
|
||||
|
||||
dist = player->argp[0][4] == 'd';
|
||||
|
||||
if (!snxtsct(&nstr, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
||||
|
@ -69,13 +66,9 @@ best(void)
|
|||
while (!player->aborted && nxtsct(&nstr2, &s2)) {
|
||||
if (s2.sct_own != player->cnum)
|
||||
continue;
|
||||
if (dist)
|
||||
s = BestDistPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
||||
else
|
||||
s = BestLandPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
||||
s = BestLandPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
||||
if (s != (s_char *)0)
|
||||
pr("Best %spath from %s to %s is %s (cost %1.3f)\n",
|
||||
(dist ? "dist" : ""),
|
||||
pr("Best path from %s to %s is %s (cost %1.3f)\n",
|
||||
xyas(s1.sct_x, s1.sct_y, player->cnum),
|
||||
xyas(s2.sct_x, s2.sct_y, player->cnum), s, cost);
|
||||
else
|
||||
|
|
|
@ -246,7 +246,6 @@ struct cmndstr player_coms[] = {
|
|||
NORM + MONEY + CAP},
|
||||
{"bdes <SECTS> <type>", 0, bdes, C_MOD, NORM},
|
||||
{"bestpath <SECTS> <SECTS>", 0, best, 0, NORM},
|
||||
{"bestdistpath <SECTS> <SECTS>", 0, best, 0, NORM},
|
||||
{"bmap <SECTS|UNIT> [s|l|p|r|t*]", 0, map, C_MOD, NORM},
|
||||
{"board <to-SHIP> [<from-SHIP>|<from-sector>]", 3, boar, C_MOD,
|
||||
NORM + MONEY + CAP},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue