1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-26 16:09:10 +00:00

(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

@@ -119,7 +119,7 @@ bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, RoadType
* Towns are not be allowed to remove non "normal" road pieces, like tram
* tracks as that would result in trams that cannot turn. */
if (_current_company == OWNER_WATER ||
(rt == ROADTYPE_ROAD && !IsValidCompanyID(_current_company))) return true;
(rt == ROADTYPE_ROAD && !Company::IsValidID(_current_company))) return true;
/* Only do the special processing if the road is owned
* by a town */
@@ -455,7 +455,7 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Road pieces are max 4 bitset values (NE, NW, SE, SW) and town can only be non-zero
* if a non-company is building the road */
if ((IsValidCompanyID(_current_company) && p2 != 0) || (_current_company == OWNER_TOWN && !IsValidTownID(p2))) return CMD_ERROR;
if ((Company::IsValidID(_current_company) && p2 != 0) || (_current_company == OWNER_TOWN && !Town::IsValidID(p2))) return CMD_ERROR;
if (_current_company != OWNER_TOWN) {
const Town *town = CalcClosestTownFromTile(tile);
p2 = (town != NULL) ? town->index : (TownID)INVALID_TOWN;