(unit_map): Don't use snxtsct(), it obeys conditionals. Use
snxtsct_area(). Callers march() and navi() clearly don't want it to use conditionals. navi() used to zap them (just removed). march() doesn't, which was a bug similar to #785447. It's less clear for caller map(). I'd argue that conditionals apply to map's argument, the unit number, not to the map itself. draw_map() zaps them anyway.
This commit is contained in:
parent
38f4026aee
commit
2ff3fe97a2
1 changed files with 12 additions and 15 deletions
|
@ -307,35 +307,32 @@ unit_map(int unit_type, int uid, struct nstr_sect *nsp, s_char *originp)
|
|||
struct shpstr origs;
|
||||
struct lndstr origl;
|
||||
struct plnstr origp;
|
||||
s_char what[64];
|
||||
struct natstr *np;
|
||||
struct genitem *gp;
|
||||
struct range range;
|
||||
|
||||
np = getnatp(player->cnum);
|
||||
if (unit_type == EF_LAND) {
|
||||
if (!getland(uid, &origl) || !player->owner || origl.lnd_own == 0)
|
||||
return RET_FAIL;
|
||||
sprintf(what, "%d:%d,%d:%d", xrel(np, origl.lnd_x - 10),
|
||||
xrel(np, origl.lnd_x + 10),
|
||||
yrel(np, origl.lnd_y - 5), yrel(np, origl.lnd_y + 5));
|
||||
gp = (struct genitem *)&origl;
|
||||
*originp = *lchr[(int)origl.lnd_type].l_name;
|
||||
} else if (unit_type == EF_PLANE) {
|
||||
if (!getplane(uid, &origp) || !player->owner || origp.pln_own == 0)
|
||||
return RET_FAIL;
|
||||
sprintf(what, "%d:%d,%d:%d", xrel(np, origp.pln_x - 10),
|
||||
xrel(np, origp.pln_x + 10),
|
||||
yrel(np, origp.pln_y - 5), yrel(np, origp.pln_y + 5));
|
||||
gp = (struct genitem *)&origp;
|
||||
*originp = *plchr[(int)origp.pln_type].pl_name;
|
||||
} else {
|
||||
if (!getship(uid, &origs) || !player->owner || origs.shp_own == 0)
|
||||
return RET_FAIL;
|
||||
sprintf(what, "%d:%d,%d:%d", xrel(np, origs.shp_x - 10),
|
||||
xrel(np, origs.shp_x + 10),
|
||||
yrel(np, origs.shp_y - 5), yrel(np, origs.shp_y + 5));
|
||||
unit_type = EF_SHIP;
|
||||
gp = (struct genitem *)&origs;
|
||||
*originp = *mchr[(int)origs.shp_type].m_name;
|
||||
}
|
||||
if (!snxtsct(nsp, what))
|
||||
return RET_FAIL;
|
||||
|
||||
range.lx = xnorm(gp->x - 10);
|
||||
range.hx = xnorm(gp->x + 11);
|
||||
range.ly = ynorm(gp->y - 5);
|
||||
range.hy = ynorm(gp->y + 6);
|
||||
xysize_range(&range);
|
||||
snxtsct_area(nsp, &range);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue