(WORLD_SZ): New.

(isok, ef_init, bmaps_intersect, bp_init, player_accept)
(finish_sects, main): Use it.

(bp_neighbors, bp_lbcost, pathcost): Use XYOFFSET().  No
functional change.
This commit is contained in:
Markus Armbruster 2007-07-28 12:12:17 +00:00
parent e24b608dc6
commit 56de7a2151
8 changed files with 18 additions and 16 deletions

View file

@ -77,7 +77,7 @@ finish_sects(int etu)
if (g_distptrs == NULL) {
logerror("First update since reboot, allocating buffer\n");
/* Allocate the information buffer */
g_distptrs = malloc((WORLD_X * WORLD_Y / 2) * sizeof(*g_distptrs));
g_distptrs = malloc(WORLD_SZ() * sizeof(*g_distptrs));
if (g_distptrs == NULL) {
logerror("malloc failed in finish_sects.\n");
return;
@ -85,7 +85,7 @@ finish_sects(int etu)
}
/* Wipe it clean */
memset(g_distptrs, 0, (WORLD_X * WORLD_Y / 2) * sizeof(*g_distptrs));
memset(g_distptrs, 0, WORLD_SZ() * sizeof(*g_distptrs));
logerror("delivering...\n");
/* Do deliveries */