(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)

This commit is contained in:
smatz
2009-05-17 01:00:56 +00:00
parent ed1e54bd84
commit 871107f529
78 changed files with 242 additions and 303 deletions

View File

@@ -61,7 +61,7 @@ CommandCost CmdStartStopVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
/* Disable the effect of p2 bit 0, when DC_AUTOREPLACE is not set */
if ((flags & DC_AUTOREPLACE) == 0) SetBit(p2, 0);
if (!IsValidVehicleID(p1)) return CMD_ERROR;
if (!Vehicle::IsValidID(p1)) return CMD_ERROR;
Vehicle *v = Vehicle::Get(p1);
@@ -334,7 +334,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
CommandCost total_cost(EXPENSES_NEW_VEHICLES);
uint32 build_argument = 2;
if (!IsValidVehicleID(p1)) return CMD_ERROR;
if (!Vehicle::IsValidID(p1)) return CMD_ERROR;
Vehicle *v = Vehicle::Get(p1);
Vehicle *v_front = v;
@@ -532,7 +532,7 @@ CommandCost SendAllVehiclesToDepot(VehicleType type, DoCommandFlag flags, bool s
*/
CommandCost CmdRenameVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
if (!IsValidVehicleID(p1)) return CMD_ERROR;
if (!Vehicle::IsValidID(p1)) return CMD_ERROR;
Vehicle *v = Vehicle::Get(p1);
if (!CheckOwnership(v->owner)) return CMD_ERROR;
@@ -565,7 +565,7 @@ CommandCost CmdChangeServiceInt(TileIndex tile, DoCommandFlag flags, uint32 p1,
{
uint16 serv_int = GetServiceIntervalClamped(p2); // Double check the service interval from the user-input
if (serv_int != p2 || !IsValidVehicleID(p1)) return CMD_ERROR;
if (serv_int != p2 || !Vehicle::IsValidID(p1)) return CMD_ERROR;
Vehicle *v = Vehicle::Get(p1);