diff --git a/include/map.h b/include/map.h index 9eba3009..6c45786a 100644 --- a/include/map.h +++ b/include/map.h @@ -52,6 +52,7 @@ extern void border(struct range *, s_char *, s_char *); #define MAP_SHIP bit(0) #define MAP_LAND bit(1) #define MAP_PLANE bit(2) +#define MAP_HIGH bit(3) #define MAP_ALL MAP_SHIP | MAP_LAND | MAP_PLANE struct mapstr { diff --git a/info/Commands/map.t b/info/Commands/map.t index 54011d70..a543ba97 100644 --- a/info/Commands/map.t +++ b/info/Commands/map.t @@ -60,6 +60,8 @@ the same for a ship. .s1 If you give an 's' flag, all your ships will be shown on the map. An 'l' flag does the same for land units, and a 'p' for planes. -'*' gives all of the above. +'*' shows all in this order: land units, ships, planes. + +To highlight sectors owned by yourself, use the 'h' flag. .s1 .SA "census, commodity, radar, realm, route, update, Maps" diff --git a/src/lib/commands/map.c b/src/lib/commands/map.c index 1b540ac3..40680750 100644 --- a/src/lib/commands/map.c +++ b/src/lib/commands/map.c @@ -118,6 +118,10 @@ map(void) case 'P': map_flags |= MAP_PLANE; break; + case 'h': + case 'H': + map_flags |= MAP_HIGH; + break; case '*': map_flags |= MAP_ALL; break; diff --git a/src/lib/common/maps.c b/src/lib/common/maps.c index 9544a781..6eda2392 100644 --- a/src/lib/common/maps.c +++ b/src/lib/common/maps.c @@ -259,6 +259,26 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp, wmap[y][x] = (*lchr[(int)land.lnd_type].l_name) & ~0x20; } } + if (map_flags & MAP_HIGH) { + register s_char *ptr; + struct sctstr sect; + + snxtsct_rewind(nsp); + if ((!player->god || country)) { + memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8); + bitinit2(nsp, bitmap, country); + } + while (nxtsct(nsp, §) && !player->aborted) { + if ((!player->god || country) && + !emp_getbit(nsp->x, nsp->y, bitmap)) { + if (!player->god) + continue; + } + ptr = &wmap[nsp->dy][nsp->dx]; + if (sect.sct_own == player->cnum) + *ptr |= 0x80; + } + } if (origin) wmap[5][10] = origin & ~0x20; for (y = nsp->range.ly, i = 0; i < nsp->range.height; y++, i++) {