(satdisp, satdisp_sect, satdisp_units): Split satdisp() into
satdisp_sect() and satdisp_units(). (satmap): Call only satdisp_sect(). No functional change. (aircombat): Call both, and call satdisp_units() even over sea. This lets spy planes spot surface ships at sea. Closes #906035.
This commit is contained in:
parent
cefe61916c
commit
cdfb17d28a
3 changed files with 19 additions and 13 deletions
|
@ -620,7 +620,8 @@ extern int sarg_area(char *, struct range *);
|
|||
extern int sarg_range(char *, coord *, coord *, int *);
|
||||
extern int sarg_list(char *, int *, int);
|
||||
/* satmap.c */
|
||||
extern void satdisp(struct sctstr *, int, int);
|
||||
extern void satdisp_sect(struct sctstr *, int);
|
||||
extern void satdisp_units(coord, coord);
|
||||
extern void satmap(int, int, int, int, int, int);
|
||||
extern void sathead(void);
|
||||
/* sect.c */
|
||||
|
|
|
@ -162,7 +162,7 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
|||
sect.sct_x, sect.sct_y,
|
||||
dchr[sect.sct_type].d_mnem, 0);
|
||||
} else if (mission_flags & P_S) {
|
||||
satdisp(§, (mission_flags & P_I) ? 10 : 50, 1);
|
||||
satdisp_sect(§, (mission_flags & P_I) ? 10 : 50);
|
||||
} else {
|
||||
/* This is borrowed from lookout */
|
||||
if (sect.sct_own == plane_owner)
|
||||
|
@ -193,6 +193,8 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
|||
mil : roundintby(mil, 25));
|
||||
PR(plane_owner, "@ %s\n", xyas(x, y, plane_owner));
|
||||
}
|
||||
if (mission_flags & P_S)
|
||||
satdisp_units(sect.sct_x, sect.sct_y);
|
||||
} else {
|
||||
PR(plane_owner, "flying over %s at %s\n",
|
||||
dchr[sect.sct_type].d_name, xyas(x, y, plane_owner));
|
||||
|
|
|
@ -120,7 +120,7 @@ satmap(int x, int y, int eff, int range, int flags, int type)
|
|||
continue;
|
||||
if (flags & P_S) {
|
||||
if (sect.sct_own && sect.sct_own != player->cnum) {
|
||||
satdisp(§, acc, 0);
|
||||
satdisp_sect(§, acc);
|
||||
++count;
|
||||
if (opt_HIDDEN)
|
||||
setcont(player->cnum, sect.sct_own, FOUND_FLY);
|
||||
|
@ -274,13 +274,8 @@ sathead(void)
|
|||
}
|
||||
|
||||
void
|
||||
satdisp(struct sctstr *sp, int acc, int showstuff)
|
||||
satdisp_sect(struct sctstr *sp, int acc)
|
||||
{
|
||||
int first;
|
||||
struct nstr_item ni;
|
||||
struct shpstr ship;
|
||||
struct lndstr land;
|
||||
|
||||
prxy("%4d,%-4d ", sp->sct_x, sp->sct_y, player->cnum);
|
||||
pr("%c %3d %3d %3d %3d %3d %4d %4d %4d %4d %4d %4d %5d\n",
|
||||
dchr[sp->sct_type].d_mnem,
|
||||
|
@ -297,9 +292,17 @@ satdisp(struct sctstr *sp, int acc, int showstuff)
|
|||
roundintby(sp->sct_item[I_FOOD], acc));
|
||||
map_set(player->cnum, sp->sct_x, sp->sct_y, dchr[sp->sct_type].d_mnem,
|
||||
0);
|
||||
if (!showstuff)
|
||||
return;
|
||||
snxtitem_xy(&ni, EF_SHIP, sp->sct_x, sp->sct_y);
|
||||
}
|
||||
|
||||
void
|
||||
satdisp_units(coord x, coord y)
|
||||
{
|
||||
int first;
|
||||
struct nstr_item ni;
|
||||
struct shpstr ship;
|
||||
struct lndstr land;
|
||||
|
||||
snxtitem_xy(&ni, EF_SHIP, x, y);
|
||||
first = 1;
|
||||
while (nxtitem(&ni, &ship)) {
|
||||
if (ship.shp_own == 0)
|
||||
|
@ -320,7 +323,7 @@ satdisp(struct sctstr *sp, int acc, int showstuff)
|
|||
if (!first)
|
||||
pr("\n");
|
||||
|
||||
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
|
||||
snxtitem_xy(&ni, EF_LAND, x, y);
|
||||
first = 1;
|
||||
|
||||
while (nxtitem(&ni, &land)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue