mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
Fixed AI ignoring garrisioned heroes when it comes to danger-analysis.
AI now considers garrisoned heros a potential threat for their heroes too.
This commit is contained in:
parent
99e4052dc0
commit
730e574bef
@ -89,6 +89,14 @@ void DangerHitMapAnalyzer::updateHitMap()
|
||||
|
||||
heroes[hero->tempOwner][hero] = HeroRole::MAIN;
|
||||
}
|
||||
if (obj->ID == Obj::TOWN)
|
||||
{
|
||||
auto town = dynamic_cast<const CGTownInstance*>(obj);
|
||||
auto hero = town->garrisonHero;
|
||||
|
||||
if(hero)
|
||||
heroes[hero->tempOwner][hero] = HeroRole::MAIN;
|
||||
}
|
||||
}
|
||||
|
||||
auto ourTowns = cb->getTownsInfo();
|
||||
|
Loading…
Reference in New Issue
Block a user