The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: yoyo on July 18, 2012, 04:35:07 PM

Title: r5830 pak64 - limit error of the schedule
Post by: yoyo on July 18, 2012, 04:35:07 PM
HI!

an error occurred when added 253th train stop to a schedule.
"FATAL ERROR : minivec_tpl<T>::resize() new size 256 too large (>255)."

[fahrplan.cc]
bool schedule_t::append(const grund_t* gr, uint8 ladegrad, uint8 waiting_time_shift)
{
   // stored in minivec, so wie have to avoid adding too many
   if(eintrag.get_count()>=254) {
      create_win( new news_img("Maximum 254 stops\nin a schedule!\n"), w_time_delete, magic_none);
      return false;
   }

   if(ist_halt_erlaubt(gr)) {
      eintrag.append(linieneintrag_t(gr->get_pos(), ladegrad, waiting_time_shift), 4);
      return true;
   }
   ...
}

> append( ... , extend = 4);
maximum 254 stops in a schedule.
but 252(stops) + 4(extend) = 256 > 255(limit of minivec)

everyone can reproduce this error. please use my savefile(saveformat = bzip2)

thank you.

----------------------------------------------------------------
[ environment ]
os            : Windows7 x64
compiler   : Visual C/C++2010 express
simutrans : r5830 / GDI / Win32 Debug / compiled from source code.
pak          : pak64 111.3 / SVN / makeobj=53
libs          : zlib 1.2.7(debug) / bzip2 1.0.6(debug)
----------------------------------------------------------------
Title: Re: r5830 pak64 - limit error of the schedule
Post by: Dwachs on July 18, 2012, 04:52:17 PM
thanks for reporting! will be fixed...

Edit: should be fixed in r5832.