r2748
On sliced underground mode, when I drag underground tunnel tool to out of underground, simutrans quits.
Message: wegbauer_t::calc_costs(): construction estimate: 2400.000000
Message: two_click_werkzeug_t::move: Button: 1, Pos: 41,54,-1
Message: wegbauer_t::route_fuer(): setting way type to 2049, besch=asphalt_road, bruecke_besch=NULL, tunnel_besch=FastRoadTunnel
Message: wegbauer_t::calc_straight_route(): from 44,54,-1 to 41,54,-1
Message: wegbauer_t::calc_straight_route(): step -1,0 = 1
Message: wegbauer_t::calc_straight_route(): step -1,0 = 1
Message: wegbauer_t::calc_straight_route(): step -1,0 = 0
Fix (Fixes also two small issues with the preview):
Index: simwerkz.cc
===================================================================
--- simwerkz.cc (revision 2748)
+++ simwerkz.cc (working copy)
@@ -1487,7 +1487,7 @@
calc_route( bauigel, start, end );
uint8 offset = (besch->get_styp()==1 && besch->get_wtyp()!=air_wt) ? 1 : 0;
- if( bauigel.get_count()>2 ) {
+ if( bauigel.get_count() > 1 ) {
// Set tooltip first (no dummygrounds, if bauigel.calc_casts() is called).
win_set_static_tooltip( tooltip_with_price("Building costs estimates", -bauigel.calc_costs() ) );
@@ -1654,7 +1654,7 @@
welt->lookup_kartenboden(end.get_2d())->clear_flag(grund_t::marked);
- if( bauigel.get_count()>2 ) {
+ if( bauigel.get_count() > 1 ) {
// Set tooltip first (no dummygrounds, if bauigel.calc_casts() is called).
win_set_static_tooltip( tooltip_with_price("Building costs estimates", -bauigel.calc_costs() ) );
Index: bauer/wegbauer.cc
===================================================================
--- bauer/wegbauer.cc (revision 2748)
+++ bauer/wegbauer.cc (working copy)
@@ -1438,6 +1438,9 @@
if(ok) {
DBG_MESSAGE("wegbauer_t::intern_calc_straight_route()","found straight route max_n=%i",get_count()-1);
}
+ else {
+ route.clear();
+ }
}
Solved. Thank you.