(svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get()

This commit is contained in:
smatz
2009-05-18 16:21:28 +00:00
parent 1eca6aefeb
commit 512db5248e
35 changed files with 201 additions and 305 deletions

View File

@@ -16,7 +16,8 @@
/* static */ bool AIGroup::IsValidGroup(GroupID group_id)
{
return ::Group::IsValidID(group_id) && ::Group::Get(group_id)->owner == _current_company;
const Group *g = ::Group::GetIfValid(group_id);
return g != NULL && g->owner == _current_company;
}
/* static */ AIGroup::GroupID AIGroup::CreateGroup(AIVehicle::VehicleType vehicle_type)