From b3115f65c5b1c50feaf3b675166bcbf22d58fbfb Mon Sep 17 00:00:00 2001 From: Xilmi Date: Thu, 5 Sep 2024 16:45:45 +0200 Subject: [PATCH] Update BuildingBehavior.cpp Use std::numeric_limits::max(); instead of UINT8_MAX; and remove some leftover-trace-messages from debugging. --- AI/Nullkiller/Behaviors/BuildingBehavior.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/AI/Nullkiller/Behaviors/BuildingBehavior.cpp b/AI/Nullkiller/Behaviors/BuildingBehavior.cpp index caed8fc1e..ab33207df 100644 --- a/AI/Nullkiller/Behaviors/BuildingBehavior.cpp +++ b/AI/Nullkiller/Behaviors/BuildingBehavior.cpp @@ -54,7 +54,7 @@ Goals::TGoalVec BuildingBehavior::decompose(const Nullkiller * ai) const for(auto & developmentInfo : developmentInfos) { bool emergencyDefense = false; - uint8_t closestThreat = UINT8_MAX; + uint8_t closestThreat = std::numeric_limits::max(); for (auto threat : ai->dangerHitMap->getTownThreats(developmentInfo.town)) { closestThreat = std::min(closestThreat, threat.turn); @@ -74,7 +74,6 @@ Goals::TGoalVec BuildingBehavior::decompose(const Nullkiller * ai) const { for (auto& buildingInfo : developmentInfo.toBuild) { - logAi->trace("Looking at %s", buildingInfo.toString()); if (isGoldPressureLow || buildingInfo.dailyIncome[EGameResID::GOLD] > 0) { if (buildingInfo.notEnoughRes) @@ -86,13 +85,11 @@ Goals::TGoalVec BuildingBehavior::decompose(const Nullkiller * ai) const composition.addNext(BuildThis(buildingInfo, developmentInfo)); composition.addNext(SaveResources(buildingInfo.buildCost)); - logAi->trace("Generate task to build: %s", buildingInfo.toString()); tasks.push_back(sptr(composition)); } else { tasks.push_back(sptr(BuildThis(buildingInfo, developmentInfo))); - logAi->trace("Generate task to build: %s", buildingInfo.toString()); } } }