diff options
author | smatz <smatz@openttd.org> | 2009-05-16 23:34:14 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-16 23:34:14 +0000 |
commit | 6221d74644922ea4bbba3ed9cd8bbec42398f77b (patch) | |
tree | 0069bbd6bb7525754c5d9353132f5dc64a0996cc /src/autoreplace_cmd.cpp | |
parent | 814f153b5a98e0030cbd221e6a89e083ce62bb1d (diff) | |
download | openttd-6221d74644922ea4bbba3ed9cd8bbec42398f77b.tar.xz |
(svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index)
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r-- | src/autoreplace_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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 */ |