From 92fcbc22a78012b32725f91ee166edb2e605349e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 13 Jan 2004 18:23:26 +0000 Subject: [PATCH] (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'. --- info/Commands/bestdistpath.t | 27 --------------------------- info/Commands/bestpath.t | 9 +-------- src/lib/commands/best.c | 11 ++--------- src/lib/player/empmod.c | 1 - 4 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 info/Commands/bestdistpath.t diff --git a/info/Commands/bestdistpath.t b/info/Commands/bestdistpath.t deleted file mode 100644 index a7781496e..000000000 --- a/info/Commands/bestdistpath.t +++ /dev/null @@ -1,27 +0,0 @@ -.TH Command BESTDISTPATH -.NA bestdistpath "Show the best distribution path from one sector to another" -.LV Expert -.SY "bestpath " -.SY "bestdistpath " -.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" diff --git a/info/Commands/bestpath.t b/info/Commands/bestpath.t index 68bb384ec..6318feb07 100644 --- a/info/Commands/bestpath.t +++ b/info/Commands/bestpath.t @@ -2,20 +2,13 @@ .NA bestpath "Show the best path from one sector to another" .LV Expert .SY "bestpath " -.SY "bestdistpath " .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. .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 diff --git a/src/lib/commands/best.c b/src/lib/commands/best.c index 39fc8b813..0add43f52 100644 --- a/src/lib/commands/best.c +++ b/src/lib/commands/best.c @@ -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 diff --git a/src/lib/player/empmod.c b/src/lib/player/empmod.c index a1f2ed94f..4f66d3e1d 100644 --- a/src/lib/player/empmod.c +++ b/src/lib/player/empmod.c @@ -246,7 +246,6 @@ struct cmndstr player_coms[] = { NORM + MONEY + CAP}, {"bdes ", 0, bdes, C_MOD, NORM}, {"bestpath ", 0, best, 0, NORM}, - {"bestdistpath ", 0, best, 0, NORM}, {"bmap [s|l|p|r|t*]", 0, map, C_MOD, NORM}, {"board [|]", 3, boar, C_MOD, NORM + MONEY + CAP}, -- 2.43.0