if (!snxtitem(&ni, type, player->argp[1], NULL))
return RET_SYN;
- if ((bitmap = malloc((WORLD_X * WORLD_Y) / 8)) == 0) {
+ bitmap = calloc(WORLD_SZ() / 8, 1);
+ if (!bitmap) {
logerror("malloc failed in do_look\n");
pr("Memory error. Tell the deity.\n");
return RET_FAIL;
}
- memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
while (nxtitem(&ni, &unit)) {
if (!player->owner)
continue;
}
}
if (!bitmap)
- bitmap = malloc((WORLD_X * WORLD_Y) / 8);
+ bitmap = malloc(WORLD_SZ() / 8);
if (!wmapbuf || !wmap || !bitmap) {
pr("Memory error, tell the deity.\n");
logerror("malloc failed in draw_map\n");
struct sctstr sect;
if (!player->god) {
- memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
+ memset(bitmap, 0, WORLD_SZ() / 8);
bitinit2(nsp, bitmap, player->cnum);
}
while (nxtsct(nsp, §) && !player->aborted) {
int changed = 0;
if (!player->god) {
- memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
+ memset(bitmap, 0, WORLD_SZ() / 8);
bitinit2(nsp, bitmap, player->cnum);
}
while (nxtsct(nsp, §) && !player->aborted) {
snxtsct_rewind(nsp);
if (!player->god) {
- memset(bitmap, 0, (WORLD_X * WORLD_Y) / 8);
+ memset(bitmap, 0, WORLD_SZ() / 8);
bitinit2(nsp, bitmap, player->cnum);
}
while (nxtsct(nsp, §) && !player->aborted) {