HandleSharingChange and its children
Currently HandleSharingChange and the functions it calls are a little ugly to say the least. The main cause for this is that sharing changes make reserved paths etc invalid. This means that we e.g. don't know which tiles to unreserve when a train is deleted, so we have to check all tiles which is very expensive.
If we call this function while everything is still valid (reading the new settings in sharing_future), this could be done in a much nicer way.
Small code snippet as reminder to self:
CompanySharingSettingsEntry *settings_to_use = c->sharing_delay == 0 ? &c->sharing_future : &c->sharing_currrent;
#1 Updated by Hirundo over 3 years ago
- % Done changed from 0 to 50
The code restructuring is done, now it needs to be tested and debugged. This is (obviously and unfortunately) the hard part.
#2 Updated by Hirundo over 3 years ago
Reminder to self: Bankruptcy / takeover needs a lot of fixing too.