Skip to content

Commit ff569e5

Browse files
committed
FIX: not connection to tunnels, bridges and elevated ways when extending city streets
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11901 8aca7d54-2c30-db11-9de9-000461428c89
1 parent ade72c8 commit ff569e5

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

simutrans/history.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
FIX: Corrected format of transformer tool icon tooltip
6565
FIX: Inline tool icons change size when zooming in or out and scaled tool icons are enabled
6666
FIX: show convoi (and line) name when permanent tooltips are enabled for convois
67+
FIX: not connection to tunnels, bridges and elevated ways when extending city streets
6768

6869

6970
Release of 124.3.1 (r11671 on 5-Apr-2025):

src/simutrans/world/simcity.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,7 +3594,7 @@ void stadt_t::generate_private_cars(koord pos, koord target)
35943594

35953595

35963596
/**
3597-
* built/extends a road and maybe changes the neighbouring tile to continue it as further as possible
3597+
* built/extends a road and maybe changes the neighbouring tile to continue it as far as possible
35983598
* @param k Bauposition
35993599
*/
36003600
bool stadt_t::build_road(const koord k, player_t* player_, bool forced)
@@ -3627,7 +3627,7 @@ bool stadt_t::build_road(const koord k, player_t* player_, bool forced)
36273627
return false;
36283628
}
36293629

3630-
// try articicial slope. For this, we need to know the height of the tile with the connecting road
3630+
// try artificial slope. For this, we need to know the height of the tile with the connecting road
36313631
for (sint8 r = 0; r < 4; r++) {
36323632
if (grund_t* gr = welt->lookup_kartenboden(k + koord::nesw[r])) {
36333633
if (gr->hat_weg(road_wt)) {
@@ -3652,6 +3652,17 @@ bool stadt_t::build_road(const koord k, player_t* player_, bool forced)
36523652
continue;
36533653
}
36543654

3655+
if (terraform_allowed && !bd->get_weg_hang() && gr->get_hoehe() != bd->get_hoehe()) {
3656+
sint8 dir = bd->get_hoehe() < gr->get_hoehe() ? +1 : -1;
3657+
// check height clearance (no bridges or tunnels would be blocked by this when becoming a slope)
3658+
// (This is only possible near articial sloes, but the check is not expensive)
3659+
if (welt->lookup(koord3d(k + koord::nesw[r], bd->get_hoehe() + dir))) {
3660+
continue;
3661+
}
3662+
if (welt->get_settings().get_way_height_clearance() == 2 && welt->lookup(koord3d(k + koord::nesw[r], bd->get_hoehe() + 2*dir))) {
3663+
continue;
3664+
}
3665+
}
36553666

36563667
// try to connect: check if other tile on slope
36573668
if (gr->get_weg_hang() && ribi_t::doubles(ribi_type(gr->get_weg_hang())) != ribi_t::doubles(ribi_t::nesw[r])) {

0 commit comments

Comments
 (0)