FS#4774 - patch: autoconvert
I would like to submit my autoconvert patch for inclusion in trunk.
This patch series implements the following two features:
a) Allow to define per-railtype replacements for a rail engine.
With the patch, an engine can have a "default" global replacement (which is the current situation) and then a particular replacement for each railtype in the game. When a train enters a depot and is checked for autoreplace, the replacements are searched using the depot's railtype first, falling back to the global list if there is none (thus preserving backwards compatibility).
A first use of this feature would be to specify different replacements for an engine; for instance, a diesel engine can be set to be replaced by an electric engine if it is running on track that has already been electrified, or by another diesel engine otherwise.
b) Allow to use the convert tool on depots with trains.
When rail conversion is attempted on a depot, trains inside are checked for replacements using the target railtype replacement list; if all of the vehicles can be successfully replaced, the depot is converted. (Otherwise, the usual "train in the way" error is thrown.)
This task depends upon