]> git.pond.sub.org Git - empserver/commitdiff
(map, draw_map): Remove undocumented feature that lets deities run map
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 23 Oct 2005 08:32:49 +0000 (08:32 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 23 Oct 2005 08:32:49 +0000 (08:32 +0000)
as another country.  It appeared around Chainsaw 3.0 and never fully
worked.  See also #1335316.

include/prototypes.h
src/lib/commands/map.c
src/lib/commands/marc.c
src/lib/commands/navi.c
src/lib/common/maps.c

index 8dc7515f2d2c887b094aacab39b982f8dac3a8f4..a5862b86f074fddd37b651b276f62da74cb6bcc7 100644 (file)
@@ -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 *);
index f534549b9a363c45afd9d512413835d09061172b..3e52d361345751de09bef5f333a7006a20590b1f 100644 (file)
@@ -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);
 }
index e5374297da820beeaff871b2dfe028ae5718424a..bfdd4203f731c63796218070621c1c1f5926f391 100644 (file)
@@ -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;
index 2e4b3cce701c5e4bc5e2290f86fdb138cee0d718..c571d8cd29d133197eb2043d2e88d4289ed3df45 100644 (file)
@@ -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;
index dd1b2a4b5fa7fb0d66d9d271e3359f4846f3084d..d3fd1f248e12dbeeced2852f7ca9d25295ecc8b3 100644 (file)
@@ -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, &sect) && !player->aborted) {
-                   if ((!player->god || country) &&
-                       !emp_getbit(nsp->x, nsp->y, bitmap)) {
-                       if (!player->god)
-                           continue;
-                   }
+                   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, &sect) && !player->aborted) {
-           if ((!player->god || country)
-               && !emp_getbit(nsp->x, nsp->y, bitmap)) {
-               if (!player->god)
-                   continue;
-           }
-           mapch = map_char(sect.sct_type, sect.sct_own,
-                            sect.sct_own == country || player->god);
+           if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
+               continue;
+           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, &sect) && !player->aborted) {
-           if ((!player->god || country) &&
-               !emp_getbit(nsp->x, nsp->y, bitmap)) {
-               if (!player->god)
-                   continue;
-           }
+           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;