(dist): Simplify.
This commit is contained in:
parent
db407ec065
commit
37b18621bc
1 changed files with 2 additions and 4 deletions
|
@ -53,7 +53,7 @@ dist(void)
|
||||||
{
|
{
|
||||||
struct sctstr sect, dsect, tsect;
|
struct sctstr sect, dsect, tsect;
|
||||||
struct nstr_sect nstr;
|
struct nstr_sect nstr;
|
||||||
char *path, *p;
|
char *p;
|
||||||
double move_cost = 0.0;
|
double move_cost = 0.0;
|
||||||
coord dstx, dsty;
|
coord dstx, dsty;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -100,9 +100,7 @@ dist(void)
|
||||||
pr("Warning: you don't own %s!\n",
|
pr("Warning: you don't own %s!\n",
|
||||||
xyas(dsect.sct_x, dsect.sct_y, player->cnum));
|
xyas(dsect.sct_x, dsect.sct_y, player->cnum));
|
||||||
|
|
||||||
path = BestDistPath(buf, §, &dsect, &move_cost, MOB_ROAD);
|
if (!BestDistPath(buf, §, &dsect, &move_cost, MOB_ROAD)) {
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
pr("No owned path from %s to %s.\n",
|
pr("No owned path from %s to %s.\n",
|
||||||
xyas(dsect.sct_x, dsect.sct_y, player->cnum),
|
xyas(dsect.sct_x, dsect.sct_y, player->cnum),
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue