From 68244393f1b590fd7f108854b197cbd16fa94686 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 3 May 2020 22:04:16 +0200 Subject: [PATCH] Codechange: Unify the tests whether build+refit is in simulation-test or real-run. --- src/vehicle_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 5ba31945fc..a5eb2087b3 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -145,7 +145,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } if (value.Succeeded()) { - if (refitting || (flags & DC_EXEC)) { + if (subflags & DC_EXEC) { v->unitnumber = unit_num; v->value = value.GetCost(); } @@ -166,7 +166,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } } - if (refitting || (flags & DC_EXEC)) { + if (subflags & DC_EXEC) { GroupStatistics::CountEngine(v, 1); GroupStatistics::UpdateAutoreplace(_current_company); @@ -178,7 +178,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* If we are not in DC_EXEC undo everything */ - if (refitting && (flags & DC_EXEC) == 0) { + if (flags != subflags) { DoCommand(0, v->index, 0, DC_EXEC, GetCmdSellVeh(v)); } }