mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20530) -Cleanup (r13507): p2 bit 0 for CmdBUildRailVehicle is no longer valid so don't use it
This commit is contained in:
parent
f9a55b7439
commit
bf29e5d860
|
@ -417,7 +417,6 @@ static void CloneVehicleName(const Vehicle *src, Vehicle *dst)
|
||||||
CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
||||||
{
|
{
|
||||||
CommandCost total_cost(EXPENSES_NEW_VEHICLES);
|
CommandCost total_cost(EXPENSES_NEW_VEHICLES);
|
||||||
uint32 build_argument = 2;
|
|
||||||
|
|
||||||
Vehicle *v = Vehicle::GetIfValid(p1);
|
Vehicle *v = Vehicle::GetIfValid(p1);
|
||||||
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR;
|
||||||
|
@ -468,8 +467,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||||
DoCommandFlag build_flags = flags;
|
DoCommandFlag build_flags = flags;
|
||||||
if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE;
|
if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE;
|
||||||
|
|
||||||
CommandCost cost = DoCommand(tile, v->engine_type, build_argument, build_flags, GetCmdBuildVeh(v));
|
CommandCost cost = DoCommand(tile, v->engine_type, 2, build_flags, GetCmdBuildVeh(v));
|
||||||
build_argument = 3; // ensure that we only assign a number to the first engine
|
|
||||||
|
|
||||||
if (cost.Failed()) {
|
if (cost.Failed()) {
|
||||||
/* Can't build a part, then sell the stuff we already made; clear up the mess */
|
/* Can't build a part, then sell the stuff we already made; clear up the mess */
|
||||||
|
|
Loading…
Reference in New Issue