(svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index)
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
{
|
||||
if (company == COMPANY_SELF) return (CompanyID)((byte)_current_company);
|
||||
|
||||
return ::IsValidCompanyID((::CompanyID)company) ? company : COMPANY_INVALID;
|
||||
return ::Company::IsValidID((::CompanyID)company) ? company : COMPANY_INVALID;
|
||||
}
|
||||
|
||||
/* static */ bool AICompany::IsMine(AICompany::CompanyID company)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
/* static */ bool AIGroup::IsValidGroup(GroupID group_id)
|
||||
{
|
||||
return ::IsValidGroupID(group_id) && ::Group::Get(group_id)->owner == _current_company;
|
||||
return ::Group::IsValidID(group_id) && ::Group::Get(group_id)->owner == _current_company;
|
||||
}
|
||||
|
||||
/* static */ AIGroup::GroupID AIGroup::CreateGroup(AIVehicle::VehicleType vehicle_type)
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
/* static */ bool AIIndustry::IsValidIndustry(IndustryID industry_id)
|
||||
{
|
||||
return ::IsValidIndustryID(industry_id);
|
||||
return ::Industry::IsValidID(industry_id);
|
||||
}
|
||||
|
||||
/* static */ char *AIIndustry::GetName(IndustryID industry_id)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
/* static */ bool AISign::IsValidSign(SignID sign_id)
|
||||
{
|
||||
return ::IsValidSignID(sign_id) && ::Sign::Get(sign_id)->owner == _current_company;
|
||||
return ::Sign::IsValidID(sign_id) && ::Sign::Get(sign_id)->owner == _current_company;
|
||||
}
|
||||
|
||||
/* static */ bool AISign::SetName(SignID sign_id, const char *name)
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
/* static */ bool AIStation::IsValidStation(StationID station_id)
|
||||
{
|
||||
return ::IsValidStationID(station_id) && ::Station::Get(station_id)->owner == _current_company;
|
||||
return ::Station::IsValidID(station_id) && ::Station::Get(station_id)->owner == _current_company;
|
||||
}
|
||||
|
||||
/* static */ StationID AIStation::GetStationID(TileIndex tile)
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
/* static */ bool AITown::IsValidTown(TownID town_id)
|
||||
{
|
||||
return ::IsValidTownID(town_id);
|
||||
return ::Town::IsValidID(town_id);
|
||||
}
|
||||
|
||||
/* static */ char *AITown::GetName(TownID town_id)
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
/* static */ bool AIVehicle::IsValidVehicle(VehicleID vehicle_id)
|
||||
{
|
||||
if (!::IsValidVehicleID(vehicle_id)) return false;
|
||||
if (!::Vehicle::IsValidID(vehicle_id)) return false;
|
||||
const Vehicle *v = ::Vehicle::Get(vehicle_id);
|
||||
return v->owner == _current_company && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::IsFreeWagon(v)));
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
/* static */ bool AIWaypoint::IsValidWaypoint(WaypointID waypoint_id)
|
||||
{
|
||||
return ::IsValidWaypointID(waypoint_id) && ::Waypoint::Get(waypoint_id)->owner == _current_company;
|
||||
return ::Waypoint::IsValidID(waypoint_id) && ::Waypoint::Get(waypoint_id)->owner == _current_company;
|
||||
}
|
||||
|
||||
/* static */ WaypointID AIWaypoint::GetWaypointID(TileIndex tile)
|
||||
|
Reference in New Issue
Block a user