(svn r4688) - Ensure the map memory is cleared after it is allocated. This fixes random deserts that sometimes occurred.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
peter1138 18 years ago
parent 73b718a667
commit 143b8d1f67

@ -40,7 +40,7 @@ void AllocateMap(uint size_x, uint size_y)
_map_tile_mask = _map_size - 1;
free(_m);
_m = malloc(_map_size * sizeof(*_m));
_m = calloc(_map_size, sizeof(*_m));
// XXX TODO handle memory shortage more gracefully
if (_m == NULL) error("Failed to allocate memory for the map");

Loading…
Cancel
Save