summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-12-08 15:47:23 +0000
committerglx <glx@openttd.org>2007-12-08 15:47:23 +0000
commitb47bce651e64ddeab722f599c0a682281b626c45 (patch)
treea45a623dcb65481ea9d84f6b9645584f075b7849 /src/map.cpp
parent2256d9d378365850ba247e7e02631cf458a4fca2 (diff)
downloadopenttd-b47bce651e64ddeab722f599c0a682281b626c45.tar.xz
(svn r11600) -Cleanup: remove extra out-of-memory checks, since it's now done in *allocT functions.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 4136740c0..a54760652 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -52,14 +52,13 @@ void AllocateMap(uint size_x, uint size_y)
free(_m);
free(_me);
- _m = CallocT<Tile>(_map_size);
- _me = CallocT<TileExtended>(_map_size);
-
/* XXX @todo handle memory shortage more gracefully
+ * CallocT does the out-of-memory check
* Maybe some attemps could be made to try with smaller maps down to 64x64
* Maybe check for available memory before doing the calls, after all, we know how big
* the map is */
- if ((_m == NULL) || (_me == NULL)) error("Failed to allocate memory for the map");
+ _m = CallocT<Tile>(_map_size);
+ _me = CallocT<TileExtended>(_map_size);
}