The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended future development discussion => Topic started by: freddyhayward on February 17, 2020, 12:27:40 PM

Title: Road-specific properties for all ways?
Post by: freddyhayward on February 17, 2020, 12:27:40 PM
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.
Title: Re: Road-specific properties for all ways?
Post by: jamespetts on February 17, 2020, 01:39:06 PM
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.