Use MAPWIDTH() to allocate map buffers

sona(), radmap2() and satmap() used WORLD_X + 1, which equals
MAPWIDTH(1).  Using MAPWIDTH() is somewhat clearer and cleaner.
This commit is contained in:
Markus Armbruster 2008-08-31 09:26:50 -04:00
parent d012940230
commit 7803cd9dd1
3 changed files with 5 additions and 5 deletions

View file

@ -91,9 +91,9 @@ radmap2(int owner,
int changed = 0;
if (!radbuf)
radbuf = malloc(WORLD_Y * (WORLD_X + 1));
radbuf = malloc(WORLD_Y * MAPWIDTH(1));
if (!visbuf)
visbuf = malloc(WORLD_Y * (WORLD_X + 1));
visbuf = malloc(WORLD_Y * MAPWIDTH(1));
if (!rad) {
rad = malloc(WORLD_Y * sizeof(char *));
if (rad && radbuf) {