summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index a07fc18d..3864580b 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -183,21 +183,19 @@ MapReader::readMap(const std::string &filename)
inflatedSize = fileSize;
}
- xmlDocPtr doc = xmlParseMemory((char*) inflated, inflatedSize);
+ XML::Document doc((char*) inflated, inflatedSize);
free(inflated);
- // Parse the inflated map data
- if (doc) {
- xmlNodePtr node = xmlDocGetRootElement(doc);
+ xmlNodePtr node = doc.rootNode();
- if (!node || !xmlStrEqual(node->name, BAD_CAST "map")) {
+ // Parse the inflated map data
+ if (node) {
+ if (!xmlStrEqual(node->name, BAD_CAST "map")) {
logger->log("Error: Not a map file (%s)!", filename.c_str());
}
- else
- {
+ else {
map = readMap(node, filename);
}
- xmlFreeDoc(doc);
} else {
logger->log("Error while parsing map file (%s)!", filename.c_str());
}