MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NormalizeTrainVehInDepot

Function NormalizeTrainVehInDepot

src/train_cmd.cpp:717–725  ·  view source on GitHub ↗

Move all free vehicles in the depot to the train */

Source from the content-addressed store, hash-verified

715
716/** Move all free vehicles in the depot to the train */
717void NormalizeTrainVehInDepot(const Train *u)
718{
719 assert(u->IsEngine());
720 for (VehicleID vehicle : GetFreeWagonsInDepot(u->tile)) {
721 if (Command<CMD_MOVE_RAIL_VEHICLE>::Do(DoCommandFlag::Execute, vehicle, u->index, true).Failed()) {
722 break;
723 }
724 }
725}
726
727static void AddRearEngineToMultiheadedTrain(Train *v)
728{

Callers 1

CmdBuildVehicleFunction · 0.85

Calls 3

GetFreeWagonsInDepotFunction · 0.85
IsEngineMethod · 0.80
FailedMethod · 0.80

Tested by

no test coverage detected