The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

r2022 - route_index overflow when loading old savegames

Started by z9999, September 17, 2008, 06:18:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


simutrans r2022

When I loading very old savegames, some games cause to crash.
These games could read in v100.0.

Message: convoi_t::register_with_line():   ( 8 ) 日産ディーゼル タンクローリー1800 registers for 1
Message: convoi_t::laden_abschliessen():   state=DRIVING, next_stop_index=8
Message: automobil_t::setze_convoi():   0876F410
Message: automobil_t::setze_convoi():   0876F410
Message: convoi_t::laden_abschliessen():   next_stop_index=65535
Message: convoi_t::laden_abschliessen():   state=DRIVING, next_stop_index=8
Message: automobil_t::setze_convoi():   0876FBB0
Message: convoi_t::laden_abschliessen():   next_stop_index=65535
Warning: convoi_t::laden_abschliessen():   cnv 10 is currently too long.
FATAL ERROR: vector_tpl<T>::[]
index out of bounds: 47 not in 0..46
Aborting program execution ...

When I changed source code like below, crash didn't happen.
But I don't understand source code well, so I'm not sure this is correct or not. in void vehikel_t::neue_fahrt(uint16 start_route_index, bool recalc)
   route_index = start_route_index+1;
   route_index = (start_route_index<cnv->get_route()->gib_max_n()) ? start_route_index+1: start_route_index;


Just F.Y.I. : prissi isn't around this week, so it might take a while until you get a reply or until something is changed.
***** PAK128 Dev Team - semi-retired*****


Well, this is not the right place to fix it., because this will misalign many other convoi. I done, then it should be rather in I will look into it. (The error is due to different diagonals and vehicle length. For replacement vehicle, which are shorter, the error should not occur.)

Well, I just started all convois one field back, if possible. Please recheck.