]> git.pond.sub.org Git - empserver/commitdiff
Drop useless checks for player->aborted in draw_map()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Apr 2011 13:36:40 +0000 (15:36 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Apr 2011 18:21:22 +0000 (20:21 +0200)
player->aborted gets set when we get an interrupt or EOF cookie from
the player, when update or shutdown abort commands, and when we abort
an attack (not relevant here).

The checks are useless: player interrupt and EOF are checked
elsewhere, and update/shutdown can run only when we yield the
processor, which we never do (output doesn't yield because C_MOD is
set).

src/lib/subs/maps.c

index 0f2475950c4db642214381d1480f9e554bbe2061..3ee12f7c23240c174d8d7a82276cba25192b648b 100644 (file)
@@ -193,19 +193,19 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
            CANT_REACH();
            /* fall through */
        case 'b':
-           while (bmnxtsct(nsp) && !player->aborted) {
+           while (bmnxtsct(nsp)) {
                if (0 != (c = player->bmap[nsp->id]))
                    wmap[nsp->dy][nsp->dx] = c;
            }
            break;
        case 't':
-           while (bmnxtsct(nsp) && !player->aborted) {
+           while (bmnxtsct(nsp)) {
                if (0 != (c = player->map[nsp->id]))
                    wmap[nsp->dy][nsp->dx] = c;
            }
            break;
        case 'r':
-           while (bmnxtsct(nsp) && !player->aborted) {
+           while (bmnxtsct(nsp)) {
                player->bmap[nsp->id] =
                    player->map[nsp->id];
                if (0 != (c = player->bmap[nsp->id]))
@@ -221,7 +221,7 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
                    memset(bitmap, 0, (WORLD_SZ() + 7) / 8);
                    bitinit2(nsp, bitmap, player->cnum);
                }
-               while (nxtsct(nsp, &sect) && !player->aborted) {
+               while (nxtsct(nsp, &sect)) {
                    if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
                        continue;
                    wmap[nsp->dy][nsp->dx]
@@ -240,7 +240,7 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
            memset(bitmap, 0, (WORLD_SZ() + 7) / 8);
            bitinit2(nsp, bitmap, player->cnum);
        }
-       while (nxtsct(nsp, &sect) && !player->aborted) {
+       while (nxtsct(nsp, &sect)) {
            if (!player->god && !emp_getbit(nsp->x, nsp->y, bitmap))
                continue;
            mapch = map_char(sect.sct_type, sect.sct_own, player->owner);
@@ -250,8 +250,6 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
        if (changed)
            writemap(player->cnum);
     }
-    if (player->aborted)
-       return RET_OK;
 
     i = 0;
     while (ef_mappable[i] != EF_BAD) {
@@ -280,7 +278,7 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
        struct sctstr sect;
 
        snxtsct_rewind(nsp);
-       while (nxtsct(nsp, &sect) && !player->aborted) {
+       while (nxtsct(nsp, &sect)) {
            if (sect.sct_own == player->cnum)
                 wmap[nsp->dy][nsp->dx] |= 0x80;
        }