summaryrefslogtreecommitdiff
path: root/src/game-server/mapreader.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-12-09 12:55:49 -0700
committerJared Adams <jaxad0127@gmail.com>2009-12-09 12:55:49 -0700
commit9587aa47d1c5584d3582828a2f53b374d49dd702 (patch)
tree6267ef69d4a2da0755c2664512c0d8bb18fed6f4 /src/game-server/mapreader.cpp
parentace44b8fa60b713eeae029afefd15bcdca51ecd6 (diff)
downloadmanaserv-9587aa47d1c5584d3582828a2f53b374d49dd702.tar.gz
manaserv-9587aa47d1c5584d3582828a2f53b374d49dd702.tar.bz2
manaserv-9587aa47d1c5584d3582828a2f53b374d49dd702.tar.xz
manaserv-9587aa47d1c5584d3582828a2f53b374d49dd702.zip
Fix detecting collision layer for maps
Diffstat (limited to 'src/game-server/mapreader.cpp')
-rw-r--r--src/game-server/mapreader.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/game-server/mapreader.cpp b/src/game-server/mapreader.cpp
index 55c7a6d8..263b26f2 100644
--- a/src/game-server/mapreader.cpp
+++ b/src/game-server/mapreader.cpp
@@ -125,7 +125,6 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
// We only support tile width of 32 at the moment
int tilew = XML::getProperty(node, "tilewidth", DEFAULT_TILE_WIDTH);
int tileh = XML::getProperty(node, "tileheight", DEFAULT_TILE_HEIGHT);
- int layerNr = 0;
Map* map = new Map(w, h, tilew, tileh);
for (node = node->xmlChildrenNode; node != NULL; node = node->next)
@@ -156,8 +155,8 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
}
else if (xmlStrEqual(node->name, BAD_CAST "layer"))
{
- // Layer 3 is collision layer.
- if (layerNr++ == 3)
+ if (utils::compareStrI(XML::getProperty(node, "name", "unnamed"),
+ "collision") == 0)
{
readLayer(node, map);
}