diff options
-rw-r--r-- | src/resources/mapreader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 9c0a9648f..4c5776e6d 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -766,6 +766,7 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map) const bool isHeightLayer = (name.substr(0, 7) == "heights"); int mask = 1; int tileCondition = -1; + int conditionLayer = 0; MapLayer::Type layerType = MapLayer::TILES; if (isCollisionLayer) @@ -817,12 +818,21 @@ void MapReader::readLayer(const XmlNodePtr node, Map *const map) { tileCondition = atoi(value.c_str()); } + else if (pname == "ConditionLayer") + { + conditionLayer = atoi(value.c_str()); + } } } if (!xmlNameEqual(childNode, "data")) continue; + // Disable for future usage "TileCondition" attribute + // if already set ConditionLayer to non zero + if (conditionLayer != 0) + tileCondition = -1; + if (layerType == MapLayer::TILES) { layer = new MapLayer(offsetX, offsetY, |