diff options
author | frosch <frosch@openttd.org> | 2020-05-03 22:04:16 +0200 |
---|---|---|
committer | frosch <github@elsenhans.name> | 2020-05-03 23:18:30 +0200 |
commit | 68244393f1b590fd7f108854b197cbd16fa94686 (patch) | |
tree | 663ccd170f1d9ae35d13a9f23dd0a6c566cff22d | |
parent | fb5fc0d80aacae9ddf85aca3e2f399d977faebe3 (diff) | |
download | openttd-68244393f1b590fd7f108854b197cbd16fa94686.tar.xz |
Codechange: Unify the tests whether build+refit is in simulation-test or real-run.
-rw-r--r-- | src/vehicle_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 5ba31945f..a5eb2087b 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)); } } |