Index: src/engine.cpp =================================================================== --- src/engine.cpp (revision 9518) +++ src/engine.cpp (working copy) @@ -348,6 +348,23 @@ } } +bool IsEngineAvailable(uint32 engineType) +{ + + Engine *e; + + FOR_ALL_ENGINES(e) { + + if(e->type == engineType && e->player_avail) { + return true; + } + } + + return false; + +} + + /** Rename an engine. * @param tile unused * @param p1 engine ID to rename Index: src/engine.h =================================================================== --- src/engine.h (revision 9518) +++ src/engine.h (working copy) @@ -153,6 +153,7 @@ void DeleteCustomEngineNames(); bool IsEngineBuildable(EngineID engine, byte type, PlayerID player); +bool IsEngineAvailable(uint32 engineType); enum { NUM_NORMAL_RAIL_ENGINES = 54, Index: src/main_gui.cpp =================================================================== --- src/main_gui.cpp (revision 9518) +++ src/main_gui.cpp (working copy) @@ -45,6 +45,8 @@ #include "network/network_gui.h" #include "industry.h" +#include "engine.h" + static int _rename_id = 1; static int _rename_what = -1; @@ -291,17 +293,23 @@ static void MenuClickBuildRoad(int index) { - ShowBuildRoadToolbar(); + if(IsEngineAvailable(VEH_ROAD)) { + ShowBuildRoadToolbar(); + } } static void MenuClickBuildWater(int index) { - ShowBuildDocksToolbar(); + if(IsEngineAvailable(VEH_SHIP)) { + ShowBuildDocksToolbar(); + } } static void MenuClickBuildAir(int index) { - ShowBuildAirToolbar(); + if(IsEngineAvailable(VEH_AIRCRAFT)) { + ShowBuildAirToolbar(); + } } #ifdef ENABLE_NETWORK