(svn r15101) -Change [API CHANGE]: more consistant naming for consts:

INVALID_TOWN_RATING        -> TOWN_RATING_INVALID
   INVALID_TRANSPORT          -> TRANSPORT_INVALID
   INVALID_ORDER              -> ORDER_INVALID
   INVALID_GROUP              -> GROUP_INVALID
   GROUP_ALL/DEFAULT          -> ALL/DEFAULT_GROUP
   VEHICLE_RAIL/ROAD/..       -> VT_RAIL/ROAD/..
   MY_COMPANY                 -> COMPANY_SELF
   FIRST/LAST/INVALID_COMPANY -> COMPANY_FIRST/LAST/INVALID
This commit is contained in:
truebrain
2009-01-16 00:05:26 +00:00
parent b9ebab0e5d
commit bd520ca562
32 changed files with 206 additions and 195 deletions

View File

@@ -139,7 +139,7 @@
/* static */ AICompany::CompanyID AITown::GetExclusiveRightsCompany(TownID town_id)
{
if (!IsValidTown(town_id)) return AICompany::INVALID_COMPANY;
if (!IsValidTown(town_id)) return AICompany::COMPANY_INVALID;
return (AICompany::CompanyID)(int8)::GetTown(town_id)->exclusivity;
}
@@ -170,9 +170,9 @@ extern uint GetMaskOfTownActions(int *nump, CompanyID cid, const Town *t);
/* static */ AITown::TownRating AITown::GetRating(TownID town_id, AICompany::CompanyID company_id)
{
if (!IsValidTown(town_id)) return INVALID_TOWN_RATING;
if (!IsValidTown(town_id)) return TOWN_RATING_INVALID;
AICompany::CompanyID company = AICompany::ResolveCompanyID(company_id);
if (company == AICompany::INVALID_COMPANY) return INVALID_TOWN_RATING;
if (company == AICompany::COMPANY_INVALID) return TOWN_RATING_INVALID;
const Town *t = ::GetTown(town_id);
if (!HasBit(t->have_ratings, company)) return TOWN_RATING_NONE;