summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2020-05-03 22:04:16 +0200
committerfrosch <github@elsenhans.name>2020-05-03 23:18:30 +0200
commit68244393f1b590fd7f108854b197cbd16fa94686 (patch)
tree663ccd170f1d9ae35d13a9f23dd0a6c566cff22d
parentfb5fc0d80aacae9ddf85aca3e2f399d977faebe3 (diff)
downloadopenttd-68244393f1b590fd7f108854b197cbd16fa94686.tar.xz
Codechange: Unify the tests whether build+refit is in simulation-test or real-run.
-rw-r--r--src/vehicle_cmd.cpp6
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));
}
}