1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 04:04:09 +01:00

Codechange: (re)set multiple bitset flags in one call. (#14017)

This commit is contained in:
Peter Nelson
2025-04-18 14:07:57 +01:00
committed by GitHub
parent 31e716449d
commit 2c59838acb
10 changed files with 11 additions and 12 deletions

View File

@@ -139,7 +139,7 @@ std::tuple<CommandCost, VehicleID, uint, uint16_t, CargoArray> CmdBuildVehicle(D
/* If we are refitting we need to temporarily purchase the vehicle to be able to
* test it. */
DoCommandFlags subflags = flags;
if (refitting && !flags.Test(DoCommandFlag::Execute)) subflags.Set(DoCommandFlag::Execute).Set(DoCommandFlag::AutoReplace);
if (refitting && !flags.Test(DoCommandFlag::Execute)) subflags.Set({DoCommandFlag::Execute, DoCommandFlag::AutoReplace});
/* Vehicle construction needs random bits, so we have to save the random
* seeds to prevent desyncs. */