News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

[patch] goods_catg_index for convoys

Started by gerw, November 11, 2009, 11:03:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


knightly

#1
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

gerw


z9999+

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