News:

SimuTranslator
Make Simutrans speak your language.

Almost certain bug in source code....

Started by neroden, March 27, 2010, 09:44:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

In gui/components/gui_convoy_assembler.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.

jamespetts

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.