The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: ceeac on October 04, 2020, 10:13:58 AM

Title: Fix for wrong insertion order during loading
Post by: ceeac on October 04, 2020, 10:13:58 AM
This patch fixes 2 small bugs during loading:
Title: Re: Fix for wrong insertion order during loading
Post by: prissi on October 04, 2020, 11:56:44 AM
objlist::add makes sure the objects are in the right order even when loading ancient savegames. However, one can save quite some time by just appending them, that is true.

The thing with freight was done to save time because appending to a list takes much longer than inserting. For that reason, stations (where order is more critical) are vector since a long time. I agree that vehicels should keep the order. In the worst case of a big ships this are 900 packets, which is a lot but not very much of a slowdown, since typical even a900 passenger ship has less than 100 packets.

One could also thing of making them a vector, especially considering the overhead of 64 pointer per ware and the better caching when going through them. On the other hand, most convoi vehicles have 1-5 packets in them.

So I incorporated this in r9270