/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* look.c: Lookout from a ship or land unit
- *
+ *
* Known contributors to this file:
* Ron Koenderink, 2006-2007
*/
if (CANT_HAPPEN(type != EF_LAND && type != EF_SHIP))
type = EF_SHIP;
- if (!snxtitem(&ni, type, player->argp[1]))
+ 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;