The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on January 23, 2012, 11:49:50 PM

Title: Is this intended (simconvoi.cc)?
Post by: jamespetts on January 23, 2012, 11:49:50 PM
Working to merge the latest Standard release into Experimental, I came accross the following in simconvoi.cc, which looks on the face of it as if it might be a mistake:


if(file->get_version()>=111001) {
         file->rdwr_long( distance_since_last_stop );
         file->rdwr_long( sum_speed_limit );
     }

    if(  file->get_version()>=111002  ) {
        file->rdwr_long( sum_speed_limit );
    }
    else if(  file->is_loading()  ) {
        // default when not saved
        maxspeed_average_count = 0;


The file->rdwr_long( sum_speed_limit ); seems to be called twice if the file version is > 111002. Is this a mistake or is this on purpose?
Title: Re: Is this intended (simconvoi.cc)?
Post by: VS on January 23, 2012, 11:59:59 PM
Intended or not, I assume this has to stay now, since it would break existing saves...

Oh wait, these are for nightlies... then it's probably fixable.
Title: Re: Is this intended (simconvoi.cc)?
Post by: TurfIt on January 24, 2012, 12:04:28 AM
That would be a classic cut'n'paste error.  :o
Title: Re: Is this intended (simconvoi.cc)?
Post by: prissi on January 24, 2012, 10:26:00 AM
It is
maxspeed_average_count (or will be after the mac OS is built an uploaded)