diff options
author | terkhen <terkhen@openttd.org> | 2010-08-02 21:06:06 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-08-02 21:06:06 +0000 |
commit | ca0751adb82094a3f7d0042f386f72f43b756575 (patch) | |
tree | cc120ec01aa7d7503c771157794a95594329af21 /src/town_gui.cpp | |
parent | f2edc728e6c8d8b74226058ab5842ef60bf34592 (diff) | |
download | openttd-ca0751adb82094a3f7d0042f386f72f43b756575.tar.xz |
(svn r20322) -Codechange: Move Expand town code to a command.
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r-- | src/town_gui.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp index e19bac29f..4a50b1211 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -454,7 +454,15 @@ public: break; case TVW_EXPAND: // expand town - only available on Scenario editor - ExpandTown(this->town); + /* Warn the user if towns are not allowed to build roads, but do this only once per OpenTTD run. */ + static bool _warn_town_no_roads = false; + + if (!_settings_game.economy.allow_town_roads && !_warn_town_no_roads) { + ShowErrorMessage(STR_ERROR_TOWN_EXPAND_WARN_NO_ROADS, INVALID_STRING_ID, WL_WARNING); + _warn_town_no_roads = true; + } + + DoCommandP(0, this->window_number, 0, CMD_EXPAND_TOWN | CMD_MSG(STR_ERROR_CAN_T_EXPAND_TOWN)); break; case TVW_DELETE: // delete town - only available on Scenario editor |