Codechange: replace INVALID_X with XID::Invalid() for PoolIDs

This commit is contained in:
Rubidium
2025-02-16 19:29:53 +01:00
committed by rubidium42
parent d13b0e0813
commit fd4adc55e3
157 changed files with 744 additions and 772 deletions

View File

@@ -229,7 +229,7 @@ void RoadVehUpdateCache(RoadVehicle *v, bool same_length)
assert(u->First() == v);
/* Update the 'first engine' */
u->gcache.first_engine = (v == u) ? INVALID_ENGINE : v->engine_type;
u->gcache.first_engine = (v == u) ? EngineID::Invalid() : v->engine_type;
/* Update the length of the vehicle. */
uint veh_len = GetRoadVehLength(u);
@@ -289,10 +289,10 @@ CommandCost CmdBuildRoadVehicle(DoCommandFlags flags, TileIndex tile, const Engi
v->cargo_cap = rvi->capacity;
v->refit_cap = 0;
v->last_station_visited = INVALID_STATION;
v->last_loading_station = INVALID_STATION;
v->last_station_visited = StationID::Invalid();
v->last_loading_station = StationID::Invalid();
v->engine_type = e->index;
v->gcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
v->gcache.first_engine = EngineID::Invalid(); // needs to be set before first callback
v->reliability = e->reliability;
v->reliability_spd_dec = e->reliability_spd_dec;
@@ -582,7 +582,7 @@ static bool RoadVehCheckTrainCrash(RoadVehicle *v)
TileIndex RoadVehicle::GetOrderStationLocation(StationID station)
{
if (station == this->last_station_visited) this->last_station_visited = INVALID_STATION;
if (station == this->last_station_visited) this->last_station_visited = StationID::Invalid();
const Station *st = Station::Get(station);
if (!CanVehicleUseStation(this, st)) {
@@ -1126,7 +1126,7 @@ static bool CanBuildTramTrackOnTile(CompanyID c, TileIndex t, RoadType rt, RoadB
/* The 'current' company is not necessarily the owner of the vehicle. */
Backup<CompanyID> cur_company(_current_company, c);
CommandCost ret = Command<CMD_BUILD_ROAD>::Do(DoCommandFlag::NoWater, t, r, rt, DRD_NONE, INVALID_TOWN);
CommandCost ret = Command<CMD_BUILD_ROAD>::Do(DoCommandFlag::NoWater, t, r, rt, DRD_NONE, TownID::Invalid());
cur_company.Restore();
return ret.Succeeded();