diff --git a/MissionEditor/IsoView.cpp b/MissionEditor/IsoView.cpp index de64211..e483142 100644 --- a/MissionEditor/IsoView.cpp +++ b/MissionEditor/IsoView.cpp @@ -5585,14 +5585,21 @@ void CIsoView::DrawMap() } - if (m.node.type > -1) { + if (m.node.type >= 0) { last_succeeded_operation = 10102; CString house = m.node.house; CString tmp; - if (Map->GetNodeAt(mapCoords + MapVec(1, 0), tmp) != m.node.index && Map->GetNodeAt(mapCoords + MapVec(0, 1), tmp) != m.node.index) { - const auto drawCoordsBld = GetRenderTargetCoordinates(mapCoords - MapVec(buildinginfo[m.node.type].h - 1, buildinginfo[m.node.type].w - 1)); + bool shouldDraw = true; + auto const leftNodeIdx = Map->GetNodeAt(mapCoords + MapVec(-1, 0), tmp); + auto const rightNodeIdx = Map->GetNodeAt(mapCoords + MapVec(0, -1), tmp); + if (leftNodeIdx == m.node.index || rightNodeIdx == m.node.index) { + shouldDraw = false; + } + + if (shouldDraw) { + const auto drawCoordsBld = GetRenderTargetCoordinates(mapCoords); COLORREF c; c = GetColor(house); diff --git a/MissionEditor/MapData.cpp b/MissionEditor/MapData.cpp index a4c65dc..85ffffc 100644 --- a/MissionEditor/MapData.cpp +++ b/MissionEditor/MapData.cpp @@ -1756,9 +1756,8 @@ void CMapData::UpdateNodes(BOOL bSave) int x = atoi(sx); int y = atoi(sy); int bid = buildingid[type]; - int d, f; - for (d = 0; d < buildinginfo[bid].h; d++) { - for (f = 0; f < buildinginfo[bid].w; f++) { + for (auto d = 0; d < buildinginfo[bid].h; d++) { + for (auto f = 0; f < buildinginfo[bid].w; f++) { int pos = x + d + (y + f) * GetIsoSize(); fielddata[pos].node.type = buildingid[type]; fielddata[pos].node.house = id;