The International Simutrans Forum


Author Topic: Almost certain bug in source code....  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Almost certain bug in source code....
« on: March 27, 2010, 09:44:39 AM »
In gui/components/

                        if(veh_action == va_insert)
                                vehicles.insert_at(0, info);
                        else if(veh_action == va_append) ;

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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Almost certain bug in source code....
« Reply #1 on: March 28, 2010, 06:05:59 PM »

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!