The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: gerw on November 11, 2009, 11:03:27 pm

Title: [patch] goods_catg_index for convoys
Post by: gerw on November 11, 2009, 11:03:27 pm
As mentioned in http://forum.simutrans.com/index.php?topic=3707.msg36171#msg36171 (http://forum.simutrans.com/index.php?topic=3707.msg36171#msg36171), here is the first part.

http://www-user.tu-chemnitz.de/~gerw/patches/rebuild_dest_1_2862_v1.patch (http://www-user.tu-chemnitz.de/~gerw/patches/rebuild_dest_1_2862_v1.patch)
Title: Re: [patch] goods_catg_index for convoys
Post by: knightly on November 12, 2009, 11:15:39 am
Hi Gerw :)

IMHO it is not necessary to determine whether goods_catg_index has changed and call welt->set_schedule_counter() in convoi_t::recalc_catg_index(), because in convoi_t::start(), line-managed convoys will always call line->recalc_catg_index(), and lineless convoys will always call welt->set_schedule_counter().

Besides, even if goods_catg_index is changed in a line-managed convoy, that doesn't necessarily mean that welt->set_schedule_counter() needs to be called. For instance, a line currently supports both pax and mail. One of its managed convoys originally supports both, but then certain vehicles are removed and now it only supports pax. The line still supports both as there are other convoys which support mail. With your code, schedule counter is incremented, which is not really necessary.

Knightly
Title: Re: [patch] goods_catg_index for convoys
Post by: gerw on November 12, 2009, 11:27:17 am
Thank you for your reply. You are right. I have removed it in the patch.

http://www-user.tu-chemnitz.de/~gerw/patches/rebuild_dest_1_2862_v2.patch (http://www-user.tu-chemnitz.de/~gerw/patches/rebuild_dest_1_2862_v2.patch)
Title: Re: [patch] goods_catg_index for convoys
Post by: z9999+ on November 12, 2009, 05:21:26 pm
[off-topic]
BTW, "Replace" feature in Simutrans-Experimental doesn't check goods_catg_index has changed or not.
So, line-managed convoys will cause problem if goods_catg_index has changed by "Replace" feature.