diff options
author | peter1138 <peter1138@openttd.org> | 2006-05-02 14:34:00 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-05-02 14:34:00 +0000 |
commit | e6abf41768a50ebbfeb676beb40e987c38bdaa27 (patch) | |
tree | f83e03e668c80c9b75a1aec4cce36cd66888b267 | |
parent | 2edf5b24f4201a16873ea6539fd6afcfe3f853e6 (diff) | |
download | openttd-e6abf41768a50ebbfeb676beb40e987c38bdaa27.tar.xz |
(svn r4688) - Ensure the map memory is cleared after it is allocated. This fixes random deserts that sometimes occurred.
-rw-r--r-- | map.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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"); |