(svn r12753) -Codechange: do not use IsDepotTypeTile() where simpler function can be used

This commit is contained in:
smatz
2008-04-17 18:24:45 +00:00
parent e098b50379
commit 059e94e355
15 changed files with 38 additions and 39 deletions

View File

@@ -130,7 +130,7 @@ static const Depot* FindClosestShipDepot(const Vehicle* v)
FOR_ALL_DEPOTS(depot) {
TileIndex tile = depot->xy;
if (IsDepotTypeTile(tile, TRANSPORT_WATER) && IsTileOwner(tile, v->owner)) {
if (IsShipDepotTile(tile) && IsTileOwner(tile, v->owner)) {
uint dist = DistanceManhattan(tile, v->tile);
if (dist < best_dist) {
best_dist = dist;
@@ -762,7 +762,7 @@ CommandCost CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
/* The ai_new queries the vehicle cost before building the route,
* so we must check against cheaters no sooner than now. --pasky */
if (!IsDepotTypeTile(tile, TRANSPORT_WATER)) return CMD_ERROR;
if (!IsShipDepotTile(tile)) return CMD_ERROR;
if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_SHIP);