src/map.cpp
changeset 8536 95419f22b9ab
parent 8466 9ce95e16f9f9
child 8596 27646407e0bc
--- a/src/map.cpp	Sat Dec 08 15:21:37 2007 +0000
+++ b/src/map.cpp	Sat Dec 08 15:47:23 2007 +0000
@@ -52,14 +52,13 @@
 	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);
 }