(tran_map, tran_nmap, tran_pmap): Split tran_map() into tran_nmap()

and tran_pmap() so that unit number arguments are interpreted
sensibly.  Users changed.

(display_region_map): New.
(cmd_move_map, tran_nmap, tran_pmap): Use it.
This commit is contained in:
Ron Koenderink 2006-07-09 18:24:31 +00:00
parent f65b255d18
commit df8dc6ab5a
4 changed files with 44 additions and 14 deletions

View file

@ -356,6 +356,35 @@ unit_map(int unit_type, int uid, struct nstr_sect *nsp, char *originp)
return RET_OK;
}
int
display_region_map(char *cmd, coord curx, coord cury, char *arg)
{
char coordinates[80], *cp;
player->argp[0] = cmd;
if (!arg || !*arg) {
struct natstr *np;
np = getnatp(player->cnum);
sprintf(coordinates, "%d:%d,%d:%d",
xrel(np, curx - 10), xrel(np, curx + 11),
yrel(np, cury - 5), yrel(np, cury + 6));
player->argp[1] = coordinates;
player->argp[2] = NULL;
} else {
player->argp[1] = arg;
cp = strchr(arg, ' ');
if (cp != NULL) {
*cp++ = '\0';
while (isspace(*cp)) cp++;
player->argp[2] = cp;
} else
player->argp[2] = NULL;
}
player->condarg = NULL;
return map();
}
int
bmaps_intersect(natid a, natid b)
{