diff options
author | smatz <smatz@openttd.org> | 2009-02-16 23:23:33 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-02-16 23:23:33 +0000 |
commit | 0878541cf2536ff11d95b45b9c7d2429f48249bd (patch) | |
tree | f3902fd7a609af5bca8383c2b341539b9c35696d /src/town_gui.cpp | |
parent | db0cd46a3f7b351e0e4163356aa190bf687954aa (diff) | |
download | openttd-0878541cf2536ff11d95b45b9c7d2429f48249bd.tar.xz |
(svn r15505) -Codechange: pass name of new town as parameter to CMD_BUILD_TOWN
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r-- | src/town_gui.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 0a5f24ad0..7a3aac6ad 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -752,7 +752,13 @@ public: static void PlaceProc_Town(TileIndex tile) { - DoCommandP(tile, town_size | city << 2 | town_layout << 3, 0, CMD_BUILD_TOWN | CMD_MSG(STR_0236_CAN_T_BUILD_TOWN_HERE), CcBuildTown); + uint32 townnameparts; + if (!GenerateTownName(&townnameparts)) { + ShowErrorMessage(STR_023A_TOO_MANY_TOWNS, STR_0236_CAN_T_BUILD_TOWN_HERE, 0, 0); + return; + } + + DoCommandP(tile, town_size | city << 2 | town_layout << 3, townnameparts, CMD_BUILD_TOWN | CMD_MSG(STR_0236_CAN_T_BUILD_TOWN_HERE), CcBuildTown); } }; |