mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
Update DefenceBehavior.cpp
Heroes will no longer rush to defend towns that have a standing garrison that they can't merge their armies with.
This commit is contained in:
parent
a2904584d3
commit
cfe4d7592a
@ -249,6 +249,16 @@ void DefenceBehavior::evaluateDefence(Goals::TGoalVec & tasks, const CGTownInsta
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!path.targetHero->canBeMergedWith(*town))
|
||||||
|
{
|
||||||
|
#if NKAI_TRACE_LEVEL >= 1
|
||||||
|
logAi->trace("Can't merge armies of hero %s and town %s",
|
||||||
|
path.targetHero->getObjectName(),
|
||||||
|
town->getObjectName());
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(path.targetHero == town->visitingHero.get() && path.exchangeCount == 1)
|
if(path.targetHero == town->visitingHero.get() && path.exchangeCount == 1)
|
||||||
{
|
{
|
||||||
#if NKAI_TRACE_LEVEL >= 1
|
#if NKAI_TRACE_LEVEL >= 1
|
||||||
|
Loading…
Reference in New Issue
Block a user