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:
parent
d012940230
commit
7803cd9dd1
3 changed files with 5 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue