1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Attempt to fix / trace crashes from Google Play statistics

This commit is contained in:
Ivan Savenko
2023-07-17 22:19:25 +03:00
parent c7d88271a9
commit 5e8a778e7d
4 changed files with 31 additions and 8 deletions

View File

@ -145,6 +145,13 @@ void MapRendererTerrain::renderTile(IMapRendererContext & context, Canvas & targ
const auto & image = storage.find(terrainIndex, rotationIndex, imageIndex);
assert(image);
if (!image)
{
logGlobal->error("Failed to find image %d for terrain %s on tile %s", imageIndex, mapTile.terType->getNameTranslated(), coordinates.toString());
return;
}
for( auto const & element : mapTile.terType->paletteAnimation)
image->shiftPalette(element.start, element.length, context.terrainImageIndex(element.length));