Index: src/newgrf.cpp =================================================================== --- src/newgrf.cpp (revision 13562) +++ src/newgrf.cpp (working copy) @@ -48,6 +48,7 @@ #include "settings_type.h" #include "map_func.h" #include +#include "rail_gui.h" #include "table/strings.h" #include "table/sprites.h" @@ -3616,7 +3617,7 @@ return true; case 0x11: // current rail tool type - *value = 0; + *value = GetCurrentRailToolType(); return true; case 0x12: // Game mode Index: src/rail_gui.cpp =================================================================== --- src/rail_gui.cpp (revision 13562) +++ src/rail_gui.cpp (working copy) @@ -857,6 +857,12 @@ } } + +RailType GetCurrentRailToolType() +{ + return _cur_railtype; +} + /* TODO: For custom stations, respect their allowed platforms/lengths bitmasks! * --pasky */ Index: src/rail_gui.h =================================================================== --- src/rail_gui.h (revision 13562) +++ src/rail_gui.h (working copy) @@ -10,5 +10,6 @@ void ShowBuildRailToolbar(RailType railtype, int button); void ReinitGuiAfterToggleElrail(bool disable); int32 ResetSignalVariant(int32 = 0); +RailType GetCurrentRailToolType(); #endif /* RAIL_GUI_H */