News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

r11772 - "by connection" sort mode fails to determine what lines a good can take

Started by Nazalassa, November 02, 2025, 09:07:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

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).
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

prissi