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)
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
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)
[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.