News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Road-specific properties for all ways?

Started by freddyhayward, February 17, 2020, 12:27:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freddyhayward

Working on congestion I realised that some properties specific to roads (private car route hashtables, congestion and connected buildings) are members of the base weg_t class. Is there a reason behind this? While I don't fully understand memory management, this would at least appear to be a significant waste.

jamespetts

Connected buildings had originally been only in road types, but I found that this caused inscrutable memory corruption for reasons that I could never deduce, which was fixed by putting them in the general way class. Out of caution, I then added the private car features to the general way class, too, to avoid this issue.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.