(map, draw_map): Remove undocumented feature that lets deities run map
as another country. It appeared around Chainsaw 3.0 and never fully worked. See also #1335316.
This commit is contained in:
parent
01c80490b9
commit
f5a1430bcf
5 changed files with 22 additions and 57 deletions
|
@ -306,7 +306,7 @@ extern void loginit(char *);
|
|||
extern void logerror(char *, ...) ATTRIBUTE((format (printf, 1, 2)));
|
||||
extern int oops(char *, char *, int);
|
||||
/* maps.c */
|
||||
extern int draw_map(int, s_char, int, struct nstr_sect *, int);
|
||||
extern int draw_map(int, s_char, int, struct nstr_sect *);
|
||||
extern int unit_map(int, int, struct nstr_sect *, s_char *);
|
||||
extern int bmaps_intersect(natid, natid);
|
||||
extern int share_bmap(natid, natid, struct nstr_sect *, s_char, s_char *);
|
||||
|
|
|
@ -57,7 +57,6 @@ map(void)
|
|||
int as_country;
|
||||
int map_flags = 0;
|
||||
int i;
|
||||
int where = 2;
|
||||
s_char what[64];
|
||||
s_char buf[1024];
|
||||
|
||||
|
@ -103,7 +102,6 @@ map(void)
|
|||
}
|
||||
b = player->argp[2];
|
||||
while (b != (s_char *)0 && (*b)) {
|
||||
where = 3;
|
||||
switch (*b) {
|
||||
case 's':
|
||||
case 'S':
|
||||
|
@ -124,18 +122,6 @@ map(void)
|
|||
case '*':
|
||||
map_flags |= MAP_ALL;
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
where = 2;
|
||||
break;
|
||||
case 't':
|
||||
if (bmap != EF_BMAP)
|
||||
goto bad_flag;
|
||||
|
@ -156,15 +142,5 @@ map(void)
|
|||
b++;
|
||||
}
|
||||
|
||||
as_country = player->cnum;
|
||||
if (player->god) {
|
||||
if (player->argp[where] != (s_char *)0) {
|
||||
as_country = atoi(player->argp[where]);
|
||||
if ((as_country < 0) || (as_country > MAXNOC)) {
|
||||
as_country = player->cnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return draw_map(bmap, origin, map_flags, &ns, as_country);
|
||||
return draw_map(bmap, origin, map_flags, &ns);
|
||||
}
|
||||
|
|
|
@ -118,11 +118,11 @@ march(void)
|
|||
++cp;
|
||||
if (cp[-1] == 'M') {
|
||||
unit_map(EF_LAND, lnd->lnd_uid, &ns, &origin);
|
||||
draw_map(0, origin, 0, &ns, player->cnum);
|
||||
draw_map(0, origin, 0, &ns);
|
||||
skip = 1;
|
||||
} else if (cp[-1] == 'B') {
|
||||
unit_map(EF_LAND, lnd->lnd_uid, &ns, &origin);
|
||||
draw_map(EF_BMAP, origin, 0, &ns, player->cnum);
|
||||
draw_map(EF_BMAP, origin, 0, &ns);
|
||||
skip = 1;
|
||||
} else if (cp[-1] == 'f') {
|
||||
struct emp_qelem *qp;
|
||||
|
|
|
@ -140,11 +140,11 @@ navi(void)
|
|||
++cp;
|
||||
if (cp[-1] == 'M') {
|
||||
unit_map(EF_SHIP, shp->shp_uid, &ns, &origin);
|
||||
draw_map(0, origin, MAP_SHIP, &ns, player->cnum);
|
||||
draw_map(0, origin, MAP_SHIP, &ns);
|
||||
skip = 1;
|
||||
} else if (cp[-1] == 'B') {
|
||||
unit_map(EF_SHIP, shp->shp_uid, &ns, &origin);
|
||||
draw_map(EF_BMAP, origin, MAP_SHIP, &ns, player->cnum);
|
||||
draw_map(EF_BMAP, origin, MAP_SHIP, &ns);
|
||||
skip = 1;
|
||||
} else if (cp[-1] == 'f') {
|
||||
struct emp_qelem *qp;
|
||||
|
|
|
@ -52,8 +52,7 @@ static int bmnxtsct(struct nstr_sect *);
|
|||
static s_char map_char(u_char type, natid own, int owner_or_god);
|
||||
|
||||
int
|
||||
draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
|
||||
int country)
|
||||
draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp)
|
||||
{
|
||||
struct natstr *np;
|
||||
struct range range;
|
||||
|
@ -98,7 +97,7 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
|
|||
player->command->c_form);
|
||||
player->command->c_flags |= C_MOD;
|
||||
}
|
||||
np = getnatp(country);
|
||||
np = getnatp(player->cnum);
|
||||
/* zap any conditionals */
|
||||
nsp->ncond = 0;
|
||||
xyrelrange(np, &nsp->range, &range);
|
||||
|
@ -132,19 +131,16 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
|
|||
{
|
||||
struct sctstr sect;
|
||||
|
||||
if ((!player->god || country)) {
|
||||
if (!player->god) {
|
||||
memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
|
||||
bitinit2(nsp, bitmap, country);
|
||||
bitinit2(nsp, bitmap, player->cnum);
|
||||
}
|
||||
while (nxtsct(nsp, §) && !player->aborted) {
|
||||
if ((!player->god || country) &&
|
||||
!emp_getbit(nsp->x, nsp->y, bitmap)) {
|
||||
if (!player->god)
|
||||
if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
|
||||
continue;
|
||||
}
|
||||
wmap[nsp->dy][nsp->dx]
|
||||
= map_char(sect.sct_newtype, sect.sct_own,
|
||||
sect.sct_own == country || player->god);
|
||||
player->owner);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -154,18 +150,14 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
|
|||
s_char mapch;
|
||||
int changed = 0;
|
||||
|
||||
if ((!player->god || country)) {
|
||||
if (!player->god) {
|
||||
memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
|
||||
bitinit2(nsp, bitmap, country);
|
||||
bitinit2(nsp, bitmap, player->cnum);
|
||||
}
|
||||
while (nxtsct(nsp, §) && !player->aborted) {
|
||||
if ((!player->god || country)
|
||||
&& !emp_getbit(nsp->x, nsp->y, bitmap)) {
|
||||
if (!player->god)
|
||||
if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
|
||||
continue;
|
||||
}
|
||||
mapch = map_char(sect.sct_type, sect.sct_own,
|
||||
sect.sct_own == country || player->god);
|
||||
mapch = map_char(sect.sct_type, sect.sct_own, player->owner);
|
||||
wmap[nsp->dy][nsp->dx] = mapch;
|
||||
changed |= map_set(player->cnum, nsp->x, nsp->y, mapch, 0);
|
||||
}
|
||||
|
@ -224,16 +216,13 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
|
|||
struct sctstr sect;
|
||||
|
||||
snxtsct_rewind(nsp);
|
||||
if ((!player->god || country)) {
|
||||
if (!player->god) {
|
||||
memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
|
||||
bitinit2(nsp, bitmap, country);
|
||||
bitinit2(nsp, bitmap, player->cnum);
|
||||
}
|
||||
while (nxtsct(nsp, §) && !player->aborted) {
|
||||
if ((!player->god || country) &&
|
||||
!emp_getbit(nsp->x, nsp->y, bitmap)) {
|
||||
if (!player->god)
|
||||
if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
|
||||
continue;
|
||||
}
|
||||
ptr = &wmap[nsp->dy][nsp->dx];
|
||||
if (sect.sct_own == player->cnum)
|
||||
*ptr |= 0x80;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue