Skip to content

Commit

Permalink
shorten road if tiles not found and try to terraform for road in fron…
Browse files Browse the repository at this point in the history
… tof townhall

git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@11438 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
prissi committed Nov 24, 2024
1 parent c874814 commit c5e9d6d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/simutrans/world/simcity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2615,10 +2615,27 @@ void stadt_t::check_bau_townhall(bool new_town)
road1.x = size.x - umziehen;
break;
}
// make them one tile shorter, if not lookup
if (!welt->lookup_kartenboden(best_pos + road0)) {
if (dir == ribi_t::east || dir == ribi_t::west) {
road0.y ++;
}
else {
road0.x ++;
}
}
if (!welt->lookup_kartenboden(best_pos + road1)) {
if (dir == ribi_t::east || dir == ribi_t::west) {
road0.y --;
}
else {
road0.x --;
}
}
// build the road in front of the townhall
if (road0!=road1) {
if (road0!=road1 && welt->lookup_kartenboden(best_pos + road0) && welt->lookup_kartenboden(best_pos + road1)) {
way_builder_t bauigel(NULL);
bauigel.init_builder(way_builder_t::strasse, welt->get_city_road(), NULL, NULL);
bauigel.init_builder(way_builder_t::strasse | way_builder_t::terraform_flag, welt->get_city_road(), NULL, NULL);
bauigel.set_build_sidewalk(true);
bauigel.calc_straight_route(welt->lookup_kartenboden(best_pos + road0)->get_pos(), welt->lookup_kartenboden(best_pos + road1)->get_pos());
bauigel.build();
Expand Down

0 comments on commit c5e9d6d

Please sign in to comment.