From fa148213572d8c48428d55ed05f984fc19445885 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 22 Oct 2015 18:01:10 +0300 Subject: Add support for layer property ConditionLayer for future usage. --- src/resources/mapreader.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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, -- cgit v1.2.3-70-g09d2