浏览代码

Merge pull request #1630 from Nordsoft91/fix-1605

Regression fix for roads in map editor
Ivan Savenko 2 年之前
父节点
当前提交
1ab0295bfb
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mapeditor/maphandler.cpp

+ 2 - 2
mapeditor/maphandler.cpp

@@ -117,7 +117,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);
@@ -129,7 +129,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);