Enable build and refit for template virtual trains.
This commit is contained in:
@@ -4751,6 +4751,16 @@ CommandCost CmdBuildVirtualRailVehicle(TileIndex tile, DoCommandFlag flags, uint
|
||||
if (train == NULL) {
|
||||
return_cmd_error(err);
|
||||
}
|
||||
|
||||
if (text && text[0] == 'R') {
|
||||
CargoID cargo = text[1];
|
||||
if (cargo >= NUM_CARGO) return CMD_ERROR;
|
||||
CargoID default_cargo = Engine::Get(eid)->GetDefaultCargoType();
|
||||
if (default_cargo != cargo) {
|
||||
CommandCost refit_res = CmdRefitVehicle(tile, flags, train->index, cargo, NULL);
|
||||
if (!refit_res.Succeeded()) return refit_res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CommandCost();
|
||||
|
Reference in New Issue
Block a user