Skip to main content
Topic: [patch] goods_catg_index for convoys (Read 1679 times) previous topic - next topic

Re: [patch] goods_catg_index for convoys

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

 

Re: [patch] goods_catg_index for convoys

Reply #3
[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.