Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.

INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
This commit is contained in:
Peter Nelson
2024-01-06 15:15:37 +00:00
committed by Peter Nelson
parent 4fd986bd07
commit 952d111b94
36 changed files with 131 additions and 129 deletions

View File

@@ -874,7 +874,7 @@ std::tuple<CommandCost, VehicleID> CmdCloneVehicle(DoCommandFlag flags, TileInde
if ((flags & DC_EXEC) && !v->IsPrimaryVehicle()) build_flags |= DC_AUTOREPLACE;
CommandCost cost;
std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command<CMD_BUILD_VEHICLE>::Do(build_flags, tile, v->engine_type, false, CT_INVALID, INVALID_CLIENT_ID);
std::tie(cost, new_veh_id, std::ignore, std::ignore, std::ignore) = Command<CMD_BUILD_VEHICLE>::Do(build_flags, tile, v->engine_type, false, INVALID_CARGO, INVALID_CLIENT_ID);
if (cost.Failed()) {
/* Can't build a part, then sell the stuff we already made; clear up the mess */
@@ -953,7 +953,7 @@ std::tuple<CommandCost, VehicleID> CmdCloneVehicle(DoCommandFlag flags, TileInde
}
} else {
const Engine *e = v->GetEngine();
CargoID initial_cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : (CargoID)CT_INVALID);
CargoID initial_cargo = (e->CanCarryCargo() ? e->GetDefaultCargoType() : INVALID_CARGO);
if (v->cargo_type != initial_cargo && IsValidCargoID(initial_cargo)) {
bool dummy;