diff options
author | rubidium <rubidium@openttd.org> | 2008-12-28 14:37:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-28 14:37:19 +0000 |
commit | e83cca7d130872b9d64523ce1a0d61306bc31599 (patch) | |
tree | 36bbbb5d389d41119ee184607bc012666dda7812 /src/engine.cpp | |
parent | 9c2c1dea067d305601650c60a67f389e090ad835 (diff) | |
download | openttd-e83cca7d130872b9d64523ce1a0d61306bc31599.tar.xz |
(svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 6df57c54c..564ff33f5 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -378,7 +378,7 @@ void EnginesDailyLoop() * @param p1 engine-prototype offered * @param p2 unused */ -CommandCost CmdWantEnginePreview(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdWantEnginePreview(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text) { Engine *e; @@ -493,15 +493,15 @@ static bool IsUniqueEngineName(const char *name) * @param p1 engine ID to rename * @param p2 unused */ -CommandCost CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) +CommandCost CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text) { if (!IsEngineIndex(p1)) return CMD_ERROR; - bool reset = StrEmpty(_cmd_text); + bool reset = StrEmpty(text); if (!reset) { - if (strlen(_cmd_text) >= MAX_LENGTH_ENGINE_NAME_BYTES) return CMD_ERROR; - if (!IsUniqueEngineName(_cmd_text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE); + if (strlen(text) >= MAX_LENGTH_ENGINE_NAME_BYTES) return CMD_ERROR; + if (!IsUniqueEngineName(text)) return_cmd_error(STR_NAME_MUST_BE_UNIQUE); } if (flags & DC_EXEC) { @@ -519,7 +519,7 @@ CommandCost CmdRenameEngine(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) } } } else { - e->name = strdup(_cmd_text); + e->name = strdup(text); _vehicle_design_names |= 3; } |