diff --git a/AI/Nullkiller/Engine/DangerHitMapAnalyzer.h b/AI/Nullkiller/Engine/DangerHitMapAnalyzer.h index 7da184e05..fc931d1ed 100644 --- a/AI/Nullkiller/Engine/DangerHitMapAnalyzer.h +++ b/AI/Nullkiller/Engine/DangerHitMapAnalyzer.h @@ -10,7 +10,7 @@ #pragma once #include "../VCAI.h" -#include "../AIHelper.h" +#include "../AIhelper.h" struct HitMapInfo { diff --git a/AI/Nullkiller/HeroManager.cpp b/AI/Nullkiller/HeroManager.cpp index 8a574222c..c0f99b1b6 100644 --- a/AI/Nullkiller/HeroManager.cpp +++ b/AI/Nullkiller/HeroManager.cpp @@ -195,7 +195,7 @@ void ExistingSkillRule::evaluateScore(const CGHeroInstance * hero, SecondarySkil upgradesLeft += SecSkillLevel::EXPERT - heroSkill.second; } - if(score >= 2 || score >= 1 && upgradesLeft <= 1) + if(score >= 2 || (score >= 1 && upgradesLeft <= 1)) score += 1.5; } diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp index 7962c6dcf..591fa197e 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp @@ -263,9 +263,6 @@ bool AINodeStorage::calculateHeroChain() for(AIPathNode & node : chains) { - if(node.coord.x == 60 && node.coord.y == 56 && node.actor) - logAi->trace(node.actor->toString()); - if(node.turns <= heroChainTurn && node.action != CGPathNode::ENodeAction::UNKNOWN) existingChains.push_back(&node); } @@ -304,8 +301,10 @@ void AINodeStorage::calculateHeroChain( { for(AIPathNode * node : variants) { - if(node == srcNode || !node->actor || node->turns > heroChainTurn - || node->action == CGPathNode::ENodeAction::UNKNOWN && node->actor->hero + if(node == srcNode + || !node->actor + || node->turns > heroChainTurn + || (node->action == CGPathNode::ENodeAction::UNKNOWN && node->actor->hero) || (node->actor->chainMask & srcNode->actor->chainMask) != 0) { continue; @@ -331,7 +330,7 @@ void AINodeStorage::calculateHeroChain( std::vector & result) const { if(carrier->armyLoss < carrier->actor->armyValue - && (carrier->action != CGPathNode::BATTLE || carrier->actor->allowBattle && carrier->specialAction) + && (carrier->action != CGPathNode::BATTLE || (carrier->actor->allowBattle && carrier->specialAction)) && other->armyLoss < other->actor->armyValue && carrier->actor->canExchange(other->actor)) { @@ -429,10 +428,7 @@ ExchangeCandidate AINodeStorage::calculateExchange( AIPathNode * otherParentNode) const { ExchangeCandidate candidate; - - auto carrierActor = carrierParentNode->actor; - auto otherActor = otherParentNode->actor; - + candidate.layer = carrierParentNode->layer; candidate.coord = carrierParentNode->coord; candidate.carrierParent = carrierParentNode; diff --git a/AI/Nullkiller/Pathfinding/PathfindingManager.cpp b/AI/Nullkiller/Pathfinding/PathfindingManager.cpp index 1708a0649..73ad7b562 100644 --- a/AI/Nullkiller/Pathfinding/PathfindingManager.cpp +++ b/AI/Nullkiller/Pathfinding/PathfindingManager.cpp @@ -136,7 +136,7 @@ Goals::TGoalVec PathfindingManager::findPaths( for(auto path : chainInfo) { - if(hero && hero.get() != path.targetHero || path.nodes.empty()) + if((hero && hero.get() != path.targetHero) || path.nodes.empty()) continue; const AIPathNodeInfo & firstNode = path.firstNode();