mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 15:11:54 +00:00
(svn r4688) - Ensure the map memory is cleared after it is allocated. This fixes random deserts that sometimes occurred.
This commit is contained in:
parent
73b718a667
commit
143b8d1f67
2
map.c
2
map.c
@ -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…
Reference in New Issue
Block a user