From 71c4325c50ae594a5adf01cac7c9e527b239cdcb Mon Sep 17 00:00:00 2001 From: skidd13 Date: Mon, 19 Nov 2007 21:02:30 +0000 Subject: (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style --- src/ai/default/default.cpp | 10 +++++----- src/ai/trolly/build.cpp | 2 +- src/ai/trolly/pathfinder.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ai') diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 1d6ca0189..419dd39bb 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -146,7 +146,7 @@ static EngineID AiChooseTrainToBuild(RailType railtype, Money money, byte flag, if (!IsCompatibleRail(rvi->railtype, railtype) || rvi->railveh_type == RAILVEH_WAGON || (rvi->railveh_type == RAILVEH_MULTIHEAD && flag & 1) || - !HASBIT(e->player_avail, _current_player) || + !HasBit(e->player_avail, _current_player) || e->reliability < 0x8A3D) { continue; } @@ -174,7 +174,7 @@ static EngineID AiChooseRoadVehToBuild(CargoID cargo, Money money, TileIndex til int32 rating; CommandCost ret; - if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) { + if (!HasBit(e->player_avail, _current_player) || e->reliability < 0x8A3D) { continue; } @@ -209,7 +209,7 @@ static EngineID AiChooseAircraftToBuild(Money money, byte flag) const Engine* e = GetEngine(i); CommandCost ret; - if (!HASBIT(e->player_avail, _current_player) || e->reliability < 0x8A3D) { + if (!HasBit(e->player_avail, _current_player) || e->reliability < 0x8A3D) { continue; } @@ -2412,7 +2412,7 @@ static EngineID AiFindBestWagon(CargoID cargo, RailType railtype) if (!IsCompatibleRail(rvi->railtype, railtype) || rvi->railveh_type != RAILVEH_WAGON || - !HASBIT(e->player_avail, _current_player)) { + !HasBit(e->player_avail, _current_player)) { continue; } @@ -3366,7 +3366,7 @@ static CommandCost AiDoBuildDefaultAirportBlock(TileIndex tile, const AiDefaultB CommandCost total_cost, ret; for (; p->mode == 0; p++) { - if (!HASBIT(avail_airports, p->attr)) return CMD_ERROR; + if (!HasBit(avail_airports, p->attr)) return CMD_ERROR; ret = DoCommand(TILE_MASK(tile + ToTileIndexDiff(p->tileoffs)), p->attr, 0, flag | DC_AUTO | DC_NO_WATER, CMD_BUILD_AIRPORT); if (CmdFailed(ret)) return CMD_ERROR; total_cost.AddCost(ret); diff --git a/src/ai/trolly/build.cpp b/src/ai/trolly/build.cpp index 472956bf6..31147b17b 100644 --- a/src/ai/trolly/build.cpp +++ b/src/ai/trolly/build.cpp @@ -250,7 +250,7 @@ EngineID AiNew_PickVehicle(Player *p) // Is it availiable? // Also, check if the reliability of the vehicle is above the AI_VEHICLE_MIN_RELIABILTY - if (!HASBIT(e->player_avail, _current_player) || e->reliability * 100 < AI_VEHICLE_MIN_RELIABILTY << 16) continue; + if (!HasBit(e->player_avail, _current_player) || e->reliability * 100 < AI_VEHICLE_MIN_RELIABILTY << 16) continue; /* Rate and compare the engine by speed & capacity */ rating = rvi->max_speed * rvi->capacity; diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp index 00fcf2fe2..bd243dd31 100644 --- a/src/ai/trolly/pathfinder.cpp +++ b/src/ai/trolly/pathfinder.cpp @@ -411,7 +411,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, if (PathFinderInfo->rail_or_road) { Foundation f = GetRailFoundation(parent_tileh, (TrackBits)(1 << AiNew_GetRailDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile))); // Maybe is BRIDGE_NO_FOUNDATION a bit strange here, but it contains just the right information.. - if (IsInclinedFoundation(f) || (!IsFoundation(f) && HASBIT(BRIDGE_NO_FOUNDATION, parent_tileh))) { + if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) { res += AI_PATHFINDER_TILE_GOES_UP_PENALTY; } else { res += AI_PATHFINDER_FOUNDATION_PENALTY; @@ -419,7 +419,7 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, } else { if (!IsRoad(parent->path.node.tile) || !IsTileType(parent->path.node.tile, MP_TUNNELBRIDGE)) { Foundation f = GetRoadFoundation(parent_tileh, (RoadBits)AiNew_GetRoadDirection(parent->path.parent->node.tile, parent->path.node.tile, current->tile)); - if (IsInclinedFoundation(f) || (!IsFoundation(f) && HASBIT(BRIDGE_NO_FOUNDATION, parent_tileh))) { + if (IsInclinedFoundation(f) || (!IsFoundation(f) && HasBit(BRIDGE_NO_FOUNDATION, parent_tileh))) { res += AI_PATHFINDER_TILE_GOES_UP_PENALTY; } else { res += AI_PATHFINDER_FOUNDATION_PENALTY; @@ -444,13 +444,13 @@ static int32 AyStar_AiPathFinder_CalculateG(AyStar *aystar, AyStarNode *current, res += AI_PATHFINDER_BRIDGE_PENALTY * GetBridgeLength(current->tile, parent->path.node.tile); // Check if we are going up or down, first for the starting point // In user_data[0] is at the 8th bit the direction - if (!HASBIT(BRIDGE_NO_FOUNDATION, parent_tileh)) { + if (!HasBit(BRIDGE_NO_FOUNDATION, parent_tileh)) { if (IsLeveledFoundation(GetBridgeFoundation(parent_tileh, (Axis)((current->user_data[0] >> 8) & 1)))) { res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY; } } // Second for the end point - if (!HASBIT(BRIDGE_NO_FOUNDATION, tileh)) { + if (!HasBit(BRIDGE_NO_FOUNDATION, tileh)) { if (IsLeveledFoundation(GetBridgeFoundation(tileh, (Axis)((current->user_data[0] >> 8) & 1)))) { res += AI_PATHFINDER_BRIDGE_GOES_UP_PENALTY; } -- cgit v1.2.3-54-g00ecf