summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-28 14:37:19 +0000
committerrubidium <rubidium@openttd.org>2008-12-28 14:37:19 +0000
commit87e5a8b52bf2f200467d65c1e17fd79548d31129 (patch)
tree36bbbb5d389d41119ee184607bc012666dda7812 /src/town_cmd.cpp
parent53679122af1e0a68bbe4e9c1f73526dd7e118df6 (diff)
downloadopenttd-87e5a8b52bf2f200467d65c1e17fd79548d31129.tar.xz
(svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index f660b2fe4..d91b941d0 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1534,7 +1534,7 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize
* @param p1 size of the town (0 = small, 1 = medium, 2 = large)
* @param p2 size mode (@see TownSizeMode)
*/
-CommandCost CmdBuildTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuildTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
/* Only in the scenario editor */
if (_game_mode != GM_EDITOR) return CMD_ERROR;
@@ -2110,22 +2110,22 @@ static bool IsUniqueTownName(const char *name)
* @param p1 town ID to rename
* @param p2 unused
*/
-CommandCost CmdRenameTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRenameTown(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
if (!IsValidTownID(p1)) return CMD_ERROR;
- bool reset = StrEmpty(_cmd_text);
+ bool reset = StrEmpty(text);
if (!reset) {
- if (strlen(_cmd_text) >= MAX_LENGTH_TOWN_NAME_BYTES) return CMD_ERROR;
- if (!IsUniqueTownName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
+ if (strlen(text) >= MAX_LENGTH_TOWN_NAME_BYTES) return CMD_ERROR;
+ if (!IsUniqueTownName(text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE);
}
if (flags & DC_EXEC) {
Town *t = GetTown(p1);
free(t->name);
- t->name = reset ? NULL : strdup(_cmd_text);
+ t->name = reset ? NULL : strdup(text);
UpdateTownVirtCoord(t);
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 1);
@@ -2314,7 +2314,7 @@ extern uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t);
* @param p1 town to do the action at
* @param p2 action to perform, @see _town_action_proc for the list of available actions
*/
-CommandCost CmdDoTownAction(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdDoTownAction(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
if (!IsValidTownID(p1) || p2 > lengthof(_town_action_proc)) return CMD_ERROR;