1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Fix missing template zIndex saving

This commit is contained in:
AlexVinS 2016-02-26 01:01:07 +03:00
parent 4a37ed99ea
commit 0de1a37d65

View File

@ -252,11 +252,7 @@ void ObjectTemplate::readJson(const JsonNode &node, const bool withTerrain)
usedTiles[mask.size() - 1 - i][line.size() - 1 - j] = charToTile(line[j]);
}
const JsonNode zindex = node["zIndex"];
if (!zindex.isNull())
printPriority = node["zIndex"].Float();
else
printPriority = 0; //default value
printPriority = node["zIndex"].Float();
}
void ObjectTemplate::writeJson(JsonNode & node, const bool withTerrain) const
@ -344,6 +340,9 @@ void ObjectTemplate::writeJson(JsonNode & node, const bool withTerrain) const
line[j] = tileToChar(usedTiles[height - 1 - i][width - 1 - j]);
mask.push_back(lineNode);
}
if(printPriority != 0)
node["zIndex"].Float() = printPriority;
}
ui32 ObjectTemplate::getWidth() const