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:
parent
b98a83f743
commit
6f5706352d
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user