Skip to main content
Topic: Almost certain bug in source code.... (Read 7120 times) previous topic - next topic

Almost certain bug in source code....

In gui/components/gui_convoy_****embler.cc:

                       //replace_frame->replace.add_vehicle(info);
                        if(veh_action == va_insert)
                        {
                                vehicles.insert_at(0, info);
                        }
                        else if(veh_action == va_append) ;
                        {
                                vehicles.append(info);
                        }

I am pretty darn sure that semicolon doesn't belong after the "else if" statement.  It has bad bad results.  The statement body for the append action is empty, and the append happens regardless of what else happened.

Attached is a patch which also patches a bunch of GCC warnings in the same file.

Re: Almost certain bug in source code....

Reply #1
Neroden,

thank you very much for the bug report - it is most appreciated. It will be fixed in the next version of Simutrans-Experimental. This issue does not, however, affect 7.2, as it is in the code for the automatic convoy replacer, which is temporarily disabled in 7.2 - but the fix is much appreciated for 8.0. Thank you!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.