1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Regression fix

This commit is contained in:
nordsoft 2023-03-05 00:20:47 +04:00
parent d55ac50e3c
commit cbb3167166

View File

@ -118,7 +118,7 @@ void MapHandler::drawRoad(QPainter & painter, int x, int y, int z)
auto & tinfo = map->getTile(int3(x, y, z)); auto & tinfo = map->getTile(int3(x, y, z));
auto * tinfoUpper = map->isInTheMap(int3(x, y - 1, z)) ? &map->getTile(int3(x, y - 1, z)) : nullptr; auto * tinfoUpper = map->isInTheMap(int3(x, y - 1, z)) ? &map->getTile(int3(x, y - 1, z)) : nullptr;
if(tinfoUpper && tinfoUpper->roadType->getId() != Road::NO_ROAD) if(tinfoUpper && tinfoUpper->roadType)
{ {
auto roadName = tinfoUpper->roadType->getJsonKey(); auto roadName = tinfoUpper->roadType->getJsonKey();
QRect source(0, tileSize / 2, tileSize, tileSize / 2); QRect source(0, tileSize / 2, tileSize, tileSize / 2);
@ -130,7 +130,7 @@ void MapHandler::drawRoad(QPainter & painter, int x, int y, int z)
} }
} }
if(tinfo.roadType->getId() != Road::NO_ROAD) //print road from this tile if(tinfo.roadType) //print road from this tile
{ {
auto roadName = tinfo.roadType->getJsonKey();; auto roadName = tinfo.roadType->getJsonKey();;
QRect source(0, 0, tileSize, tileSize / 2); QRect source(0, 0, tileSize, tileSize / 2);