The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: z9999+ on October 13, 2009, 05:20:40 am

Title: [solved] Quit during dragging underground tunnel tool
Post by: z9999+ on October 13, 2009, 05:20:40 am
r2748

On sliced underground mode, when I drag underground tunnel tool to out of underground, simutrans quits.

Quote
****ertion failed!

Program:
File: bauer/wegbauer.cc
Line: 1703

Expression: tunnel

For information on how your program can cause an ****ertion
failure, see the Visual C++ documentation on ****erts

(Press Retry to debug the application - JIT must be enabled)

Quote
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
Title: Re: [bug r2748] Quit during dragging underground tunnel tool
Post by: gerw on October 13, 2009, 06:40:01 am
Fix (Fixes also two small issues with the preview):
Code: [Select]
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();
+       }
 }
 
 
Title: Re: [solved] Quit during dragging underground tunnel tool
Post by: z9999+ on October 14, 2009, 04:59:56 am
Solved. Thank you.