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

Possible fix for #2371

This commit is contained in:
DjWarmonger 2016-02-06 12:36:56 +01:00
parent b98a83f743
commit 6f5706352d

View File

@ -258,11 +258,18 @@ void ObjectTemplate::readJson(const JsonNode &node)
ui32 ObjectTemplate::getWidth() const
{
return usedTiles.empty() ? 0 : usedTiles.front().size();
//TODO: Use 2D array
ui32 ret = 0;
for (auto row : usedTiles)
{
ret = std::max(ret, row.size());
}
return ret;
}
ui32 ObjectTemplate::getHeight() const
{
//TODO: Use 2D array
return usedTiles.size();
}