Explorar o código

Nullkiller: fix build and some warnings

Andrii Danylchenko %!s(int64=4) %!d(string=hai) anos
pai
achega
fdd5be1e40

+ 1 - 1
AI/Nullkiller/Engine/DangerHitMapAnalyzer.h

@@ -10,7 +10,7 @@
 #pragma once
 
 #include "../VCAI.h"
-#include "../AIHelper.h"
+#include "../AIhelper.h"
 
 struct HitMapInfo
 {

+ 1 - 1
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;
 }
 

+ 6 - 10
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<ExchangeCandidate> & 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;

+ 1 - 1
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();