(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
|
@ -1,27 +0,0 @@
|
||||||
.TH Command BESTDISTPATH
|
|
||||||
.NA bestdistpath "Show the best distribution path from one sector to another"
|
|
||||||
.LV Expert
|
|
||||||
.SY "bestpath <SECTS> <SECTS>"
|
|
||||||
.SY "bestdistpath <SECTS> <SECTS>"
|
|
||||||
.s1
|
|
||||||
The bestpath & bestdistpath commands show you the best path from any sector
|
|
||||||
to any sector. You must own both sectors.
|
|
||||||
.s1
|
|
||||||
The path shown by bestpath is the cheapest
|
|
||||||
owned existing path in terms of mobility.
|
|
||||||
.s1
|
|
||||||
Bestdistpath shows the best distribution path that can be found, which
|
|
||||||
should be the same as the best path..
|
|
||||||
During the update, sectors distribute to
|
|
||||||
and from their distribution point by means of the best distribution path
|
|
||||||
they can find at that time.
|
|
||||||
.s1
|
|
||||||
Note that if you give these commands areas, they will show you more paths.
|
|
||||||
For example,
|
|
||||||
.s1
|
|
||||||
.EX bestpath #1 #2
|
|
||||||
.s1
|
|
||||||
will show the best paths from all sectors in realm 1 to all the sectors in
|
|
||||||
realm 2.
|
|
||||||
.s1
|
|
||||||
.SA "distribute, Maps"
|
|
|
@ -2,20 +2,13 @@
|
||||||
.NA bestpath "Show the best path from one sector to another"
|
.NA bestpath "Show the best path from one sector to another"
|
||||||
.LV Expert
|
.LV Expert
|
||||||
.SY "bestpath <SECTS> <SECTS>"
|
.SY "bestpath <SECTS> <SECTS>"
|
||||||
.SY "bestdistpath <SECTS> <SECTS>"
|
|
||||||
.s1
|
.s1
|
||||||
The bestpath & bestdistpath commands show you the best path from any sector
|
The bestpath command shows you the best path from any sector
|
||||||
to any sector. You must own both sectors.
|
to any sector. You must own both sectors.
|
||||||
.s1
|
.s1
|
||||||
The path shown by bestpath is the cheapest
|
The path shown by bestpath is the cheapest
|
||||||
owned existing path in terms of mobility.
|
owned existing path in terms of mobility.
|
||||||
.s1
|
.s1
|
||||||
Bestdistpath shows the best distribution path that can be found, which
|
|
||||||
should be the same as the best path.
|
|
||||||
During the update, sectors distribute to
|
|
||||||
and from their distribution point by means of the best distribution path
|
|
||||||
they can find at that time.
|
|
||||||
.s1
|
|
||||||
Note that if you give these commands areas, they will show you more paths.
|
Note that if you give these commands areas, they will show you more paths.
|
||||||
For example,
|
For example,
|
||||||
.s1
|
.s1
|
||||||
|
|
|
@ -51,11 +51,8 @@ best(void)
|
||||||
s_char *BestDistPath(), *BestLandPath(), *s;
|
s_char *BestDistPath(), *BestLandPath(), *s;
|
||||||
struct sctstr s1, s2;
|
struct sctstr s1, s2;
|
||||||
struct nstr_sect nstr, nstr2;
|
struct nstr_sect nstr, nstr2;
|
||||||
int dist = 0;
|
|
||||||
s_char buf[1024];
|
s_char buf[1024];
|
||||||
|
|
||||||
dist = player->argp[0][4] == 'd';
|
|
||||||
|
|
||||||
if (!snxtsct(&nstr, player->argp[1]))
|
if (!snxtsct(&nstr, player->argp[1]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
|
@ -69,13 +66,9 @@ best(void)
|
||||||
while (!player->aborted && nxtsct(&nstr2, &s2)) {
|
while (!player->aborted && nxtsct(&nstr2, &s2)) {
|
||||||
if (s2.sct_own != player->cnum)
|
if (s2.sct_own != player->cnum)
|
||||||
continue;
|
continue;
|
||||||
if (dist)
|
s = BestLandPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
||||||
s = BestDistPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
|
||||||
else
|
|
||||||
s = BestLandPath(buf, &s1, &s2, &cost, MOB_ROAD);
|
|
||||||
if (s != (s_char *)0)
|
if (s != (s_char *)0)
|
||||||
pr("Best %spath from %s to %s is %s (cost %1.3f)\n",
|
pr("Best path from %s to %s is %s (cost %1.3f)\n",
|
||||||
(dist ? "dist" : ""),
|
|
||||||
xyas(s1.sct_x, s1.sct_y, player->cnum),
|
xyas(s1.sct_x, s1.sct_y, player->cnum),
|
||||||
xyas(s2.sct_x, s2.sct_y, player->cnum), s, cost);
|
xyas(s2.sct_x, s2.sct_y, player->cnum), s, cost);
|
||||||
else
|
else
|
||||||
|
|
|
@ -246,7 +246,6 @@ struct cmndstr player_coms[] = {
|
||||||
NORM + MONEY + CAP},
|
NORM + MONEY + CAP},
|
||||||
{"bdes <SECTS> <type>", 0, bdes, C_MOD, NORM},
|
{"bdes <SECTS> <type>", 0, bdes, C_MOD, NORM},
|
||||||
{"bestpath <SECTS> <SECTS>", 0, best, 0, 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},
|
{"bmap <SECTS|UNIT> [s|l|p|r|t*]", 0, map, C_MOD, NORM},
|
||||||
{"board <to-SHIP> [<from-SHIP>|<from-sector>]", 3, boar, C_MOD,
|
{"board <to-SHIP> [<from-SHIP>|<from-sector>]", 3, boar, C_MOD,
|
||||||
NORM + MONEY + CAP},
|
NORM + MONEY + CAP},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue