mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +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:
@ -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();
|
||||
|
Reference in New Issue
Block a user