From 6221d74644922ea4bbba3ed9cd8bbec42398f77b Mon Sep 17 00:00:00 2001 From: smatz Date: Sat, 16 May 2009 23:34:14 +0000 Subject: (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) --- src/autoreplace_cmd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/autoreplace_cmd.cpp') diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 1453a2a9a..acfd985ec 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -47,7 +47,7 @@ bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company) /* we can't replace an engine into itself (that would be autorenew) */ if (from == to) return false; - VehicleType type = GetEngine(from)->type; + VehicleType type = Engine::Get(from)->type; /* check that the new vehicle type is available to the company and its type is the same as the original one */ if (!IsEngineBuildable(to, type, company)) return false; @@ -247,7 +247,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic *new_vehicle = NULL; /* Shall the vehicle be replaced? */ - const Company *c = GetCompany(_current_company); + const Company *c = Company::Get(_current_company); EngineID e = GetNewEngineType(old_veh, c); if (e == INVALID_ENGINE) return CommandCost(); // neither autoreplace is set, nor autorenew is triggered @@ -259,7 +259,7 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic CommandCost cost = DoCommand(old_veh->tile, e, 0, DC_EXEC | DC_AUTOREPLACE, GetCmdBuildVeh(old_veh)); if (cost.Failed()) return cost; - Vehicle *new_veh = GetVehicle(_new_vehicle_id); + Vehicle *new_veh = Vehicle::Get(_new_vehicle_id); *new_vehicle = new_veh; /* Refit the vehicle if needed */ @@ -609,7 +609,7 @@ CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1 bool nothing_to_do = true; if (!IsValidVehicleID(p1)) return CMD_ERROR; - Vehicle *v = GetVehicle(p1); + Vehicle *v = Vehicle::Get(p1); if (!CheckOwnership(v->owner)) return CMD_ERROR; if (!v->IsInDepot()) return CMD_ERROR; if (HASBITS(v->vehstatus, VS_CRASHED)) return CMD_ERROR; @@ -623,7 +623,7 @@ CommandCost CmdAutoreplaceVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1 if (!v->IsPrimaryVehicle()) return CMD_ERROR; } - const Company *c = GetCompany(_current_company); + const Company *c = Company::Get(_current_company); bool wagon_removal = c->settings.renew_keep_length; /* Test whether any replacement is set, before issuing a whole lot of commands that would end in nothing changed */ -- cgit v1.2.3-54-g00ecf