1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Nullkiller: rework prioritization, add hero roles, skills and other variables

This commit is contained in:
Andrii Danylchenko
2021-05-15 22:02:27 +03:00
committed by Andrii Danylchenko
parent 531d0af95b
commit 5fe2630c64
10 changed files with 156 additions and 146 deletions

View File

@@ -330,7 +330,10 @@ void AINodeStorage::calculateHeroChain(
AIPathNode * other,
std::vector<ExchangeCandidate> & result) const
{
if(carrier->actor->canExchange(other->actor))
if(carrier->armyLoss < carrier->actor->armyValue
&& (carrier->action != CGPathNode::BATTLE || carrier->actor->allowBattle && carrier->specialAction)
&& other->armyLoss < other->actor->armyValue
&& carrier->actor->canExchange(other->actor))
{
#if VCMI_TRACE_PATHFINDER >= 2
logAi->trace(