diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-09 15:21:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-09 15:21:54 +0300 |
commit | 0148cb8ad0e071464f09ada9eb41625dee038cb8 (patch) | |
tree | 8bb555b4e6f36c336a8c934ede9deb9fd9cfbfa8 /src | |
parent | cf61a24f6551fd4d4d9c61b085f389c0f83e7517 (diff) | |
download | plus-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.gz plus-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.bz2 plus-0148cb8ad0e071464f09ada9eb41625dee038cb8.tar.xz plus-0148cb8ad0e071464f09ada9eb41625dee038cb8.zip |
Remove loading maps from gzipped file.
This mode probably was used only in some very old clients.
Diffstat (limited to 'src')
-rw-r--r-- | src/resources/mapreader.cpp | 31 |
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(); |