summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-09 15:21:54 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-09 15:21:54 +0300
commit0148cb8ad0e071464f09ada9eb41625dee038cb8 (patch)
tree8bb555b4e6f36c336a8c934ede9deb9fd9cfbfa8 /src/resources
parentcf61a24f6551fd4d4d9c61b085f389c0f83e7517 (diff)
downloadmv-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.gz
mv-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.bz2
mv-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.xz
mv-0148cb8ad0e071464f09ada9eb41625dee038cb8.zip
Remove loading maps from gzipped file.
This mode probably was used only in some very old clients.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/mapreader.cpp31
1 files changed, 3 insertions, 28 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index bcafe4bb7..1e59b1673 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -190,7 +190,7 @@ Map *MapReader::readMap(const std::string &restrict filename,
// Load the file through resource manager
const ResourceManager *const resman = ResourceManager::getInstance();
int fileSize;
- void *buffer = resman->loadFile(realFilename, fileSize);
+ void *const buffer = resman->loadFile(realFilename, fileSize);
Map *map = nullptr;
if (!buffer)
@@ -199,33 +199,8 @@ Map *MapReader::readMap(const std::string &restrict filename,
return createEmptyMap(filename, realFilename);
}
- unsigned char *inflated = nullptr;
- unsigned int inflatedSize;
-
- if (realFilename.find(".gz", realFilename.length() - 3)
- != std::string::npos)
- {
- // Inflate the gzipped map data
- inflatedSize = inflateMemory(static_cast<unsigned char*>(buffer),
- fileSize, inflated);
- free(buffer);
-
- if (!inflated)
- {
- logger->log("Could not decompress map file (%s)",
- realFilename.c_str());
- BLOCK_END("MapReader::readMap")
- return nullptr;
- }
- }
- else
- {
- inflated = static_cast<unsigned char*>(buffer);
- inflatedSize = fileSize;
- }
-
- XML::Document doc(reinterpret_cast<char*>(inflated), inflatedSize);
- free(inflated);
+ XML::Document doc(reinterpret_cast<const char*>(buffer), fileSize);
+ free(buffer);
XmlNodePtrConst node = doc.rootNode();