Details

To Reproduce:
1. Open a depot window and click the 'New Vehicles' button.
2. Deselect the vehicle by doing the following:
3. Select a vehicle. (Example: a locomotive without any capacity)
4. Filter the list such that the selected vehicle disappears. (Example: Show only vehicles that can carry <cargo name>.)
5. Click the 'Buy Vehicle' button in the vehicle selection window.
-> Nothing happens. The button is not greyed out, but it does nothing. Please fix this.

0-disable-build-button-if-no-engine-selected.diff
Fixes the issue (disables/enables the button when needed).

1-select-first-available-rail-engine-to-buy.diff
Enable auto-selecting first available engine also in train lists (currently, when the selected train is being filtered out, nothing gets selected). Also remove some duplicated code.