Use nstr_sect member id instead of recomputing it

bmnxtsct() sets it.  The old code recomputed it with sctoff() without
checking for failure.  Not a bug, because it can't actually fail, just
confusing.
This commit is contained in:
Markus Armbruster 2008-03-24 11:42:53 +01:00
parent a530ea4d65
commit 9c8109768d

View file

@ -177,21 +177,21 @@ draw_map(int bmap, char origin, int map_flags, struct nstr_sect *nsp)
/* fall through */ /* fall through */
case 'b': case 'b':
while (bmnxtsct(nsp) && !player->aborted) { while (bmnxtsct(nsp) && !player->aborted) {
if (0 != (c = player->bmap[sctoff(nsp->x, nsp->y)])) if (0 != (c = player->bmap[nsp->id]))
wmap[nsp->dy][nsp->dx] = c; wmap[nsp->dy][nsp->dx] = c;
} }
break; break;
case 't': case 't':
while (bmnxtsct(nsp) && !player->aborted) { while (bmnxtsct(nsp) && !player->aborted) {
if (0 != (c = player->map[sctoff(nsp->x, nsp->y)])) if (0 != (c = player->map[nsp->id]))
wmap[nsp->dy][nsp->dx] = c; wmap[nsp->dy][nsp->dx] = c;
} }
break; break;
case 'r': case 'r':
while (bmnxtsct(nsp) && !player->aborted) { while (bmnxtsct(nsp) && !player->aborted) {
player->bmap[sctoff(nsp->x, nsp->y)] = player->bmap[nsp->id] =
player->map[sctoff(nsp->x, nsp->y)]; player->map[nsp->id];
if (0 != (c = player->bmap[sctoff(nsp->x, nsp->y)])) if (0 != (c = player->bmap[nsp->id]))
wmap[nsp->dy][nsp->dx] = c; wmap[nsp->dy][nsp->dx] = c;
} }
ef_write(EF_BMAP, player->cnum, player->bmap); ef_write(EF_BMAP, player->cnum, player->bmap);