Add #5006: Flag to hide rail type from construction.

This commit is contained in:
Peter Nelson
2019-02-05 08:23:25 +00:00
committed by PeterN
parent 4764d1c45e
commit e3b440c9c5
4 changed files with 25 additions and 4 deletions

View File

@@ -1757,7 +1757,10 @@ bool CanBuildVehicleInfrastructure(VehicleType type)
UnitID max;
switch (type) {
case VEH_TRAIN: max = _settings_game.vehicle.max_trains; break;
case VEH_TRAIN:
if (!HasAnyRailtypesAvail(_local_company)) return false;
max = _settings_game.vehicle.max_trains;
break;
case VEH_ROAD: max = _settings_game.vehicle.max_roadveh; break;
case VEH_SHIP: max = _settings_game.vehicle.max_ships; break;
case VEH_AIRCRAFT: max = _settings_game.vehicle.max_aircraft; break;