summaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-02 14:34:00 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-02 14:34:00 +0000
commit143b8d1f675508975515ad7545c3d9f5e4a66885 (patch)
treef83e03e668c80c9b75a1aec4cce36cd66888b267 /map.c
parent73b718a667e033f49d76d7673fa2d4d67178a5df (diff)
downloadopenttd-143b8d1f675508975515ad7545c3d9f5e4a66885.tar.xz
(svn r4688) - Ensure the map memory is cleared after it is allocated. This fixes random deserts that sometimes occurred.
Diffstat (limited to 'map.c')
-rw-r--r--map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/map.c b/map.c
index 81b23637f..306ccb83b 100644
--- a/map.c
+++ b/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");