News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Timeline not working on latest rev

Started by wlindley, August 11, 2012, 10:20:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wlindley

The latest revision in the git repository seems to use the sets->get_use_timeline() function as a two-bit field instead of a binary flag.   See gui/welt.cc around line 494 and the comments suggest LSB as "timeline on" while second bit (value 2) for "pakfile permits user to enable/disable timeline" -- for example,

gui/welt.cc:493:        if(sets->get_use_timeline()&2) {

However, many places in the code still expect this to be a simple boolean flag, as for example:

player/ai_passenger.cc:1466    if(welt->use_timeline()  &&  line->count_convoys()>1)
...
gui/citybuilding_edit.cc:118:            if(!use_timeline  ||  (!besch->is_future(month_now)  &&  (!besch->is_retired(month_now)  ||  allow_obsolete))  ) {
{


The net result is that even when the timeline is turned on in the New Game dialog, new cities are built as if the timeline were off.  I tested this with the latest Pak128.Britain-Ex from the git repository, whose new simuconf.tab has use_timeline = 2.

Stylistically, use of magic numbers like 1 and 2 in code should be avoided; a constant should be defined... and the remainder of code using what was formerly a simple flag must be checked to verify it is handled as a bit-field.

Bottom line, the timeline option is currently broken.  Changing simutab.conf to have use_timeline = 1 at least makes things work.

jamespetts

Thank you for the report - I have now reverted my changes here back to the code as it is in previous versions and Standard. I have found that the proper way of having the timeline set on by default but able to be turned off in the new world dialogue is to have use_timeline = 3 in the pakset's simuconf.tab: having it in the base simuconf.tab will not suffice, it seems.
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.