summaryrefslogtreecommitdiff
path: root/src/autoreplace_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
commite83cca7d130872b9d64523ce1a0d61306bc31599 (patch)
tree36bbbb5d389d41119ee184607bc012666dda7812 /src/autoreplace_cmd.cpp
parent9c2c1dea067d305601650c60a67f389e090ad835 (diff)
downloadopenttd-e83cca7d130872b9d64523ce1a0d61306bc31599.tar.xz
(svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 24ec80dbd..c0483ff1c 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -330,9 +330,7 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head,
if (cost.Succeeded() && old_head != new_head && (flags & DC_EXEC) != 0) {
/* Copy vehicle name */
if (old_head->name != NULL) {
- _cmd_text = old_head->name;
- DoCommand(0, new_head->index, 0, DC_EXEC | DC_AUTOREPLACE, CMD_RENAME_VEHICLE);
- _cmd_text = NULL;
+ DoCommand(0, new_head->index, 0, DC_EXEC | DC_AUTOREPLACE, CMD_RENAME_VEHICLE, old_head->name);
}
/* Copy other things which cannot be copied by a command and which shall not stay resetted from the build vehicle command */
@@ -607,7 +605,7 @@ static CommandCost ReplaceChain(Vehicle **chain, uint32 flags, bool wagon_remova
* @param p1 Index of vehicle
* @param p2 not used
*/
-CommandCost CmdAutoreplaceVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdAutoreplaceVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2, const char *text)
{
CommandCost cost = CommandCost(EXPENSES_NEW_VEHICLES, 0);
bool nothing_to_do = true;