Page 1 of 1

NoGo: Change in OpenTTD regarding bankruptcy and takeover

Posted: 10 Feb 2013 20:19
by Zuu
As of r24986 OpenTTD will now clean up company related entities when a company is closed down or taken over. This change applies both to company specific goals and cargo monitors. So players will no longer end up seeing goals from some old bankrupt company because the GS was not quick enough to remove those.

Due to the nature of this change, note that scripts that are using API 1.2 in 1.3 will still show the new behaviour. If you want to write a GS that is compatible with both 1.2 and 1.3 behaviour, assume the 1.2 behaviour (eg. try to clean up yourself) and ignore that removing goals will fail due to invalid goal ID. Another way is to use GSController::GetVersion to detect the OpenTTD version. Or just drop support for 1.2 when 1.3 is released.


My judgment is that this change will not break many if any scripts, but will help GS authors who write scripts that do not break apart its tasks into small chunks that are interleaved with calls to code that polls the event stack to quickly process new events.