Mercurial > hg > openttd
diff src/autoreplace_cmd.cpp @ 10499:45ca88a8de7d draft
(svn r14754) -Codechange: get rid of _cmd_text and just pass it as (optional) parameter.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 28 Dec 2008 14:37:19 +0000 |
parents | d37d615dd184 |
children | a4e5b5d2837c |
line wrap: on
line diff
--- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -330,9 +330,7 @@ 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 @@ * @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;