The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Nazalassa on November 02, 2025, 09:07:47 AM

Title: r11772 - "by connection" sort mode fails to determine what lines a good can take
Post by: Nazalassa on November 02, 2025, 09:07:47 AM
While testing r11772 on a large map I noticed an issue with the "by connection" sort mode: mail was sometimes not merged when it should have been, and for freight no line was even displayed.

Eventually the problem I found is: there is good category, good category index, and good index. I found that, while checking for common lines or convoys, the good category or index was used, and searched for in the line/convoy's list of supported category indices. While for passengers all these three things are usually equal (to 0), for other goods they aren't, causing problems.

Fix: when determining whether a good can take a convoy/line or not, use the category index. There lacks a method to get it from ware_t, so the patch adds it as well.



Clarification: what is the difference between index, category index and category?
- The good index is unique for each different type of good.
- The good category refers to the category it belongs to, or 0 if the good has no category (i.e special freight).
- The good category index is such that two goods have the same category index when they can be interchangeably transported by the same vehicles. Id est, all special goods have their own category index, and all other goods share a category index with other goods of the same category (e.g bulk goods).
Title: Re: r11772 - "by connection" sort mode fails to determine what lines a good can take
Post by: prissi on November 02, 2025, 11:25:26 AM
DOne in r11785.