mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
- Improved exploration algorithm. AI will avoid dead-end barriers and thus explore much faster.
- Fixed crash when there are no heroes available to recruit in the map. TODO: make AI handle it - Fixed crash when Chain Lightning has not enough targets - Fixed crash at Hill Fort (?) - AI will buy Spellbook for its heroes - AI will try to use Cartographer and Observatory when exploring - AI will not visit Prison when heroes are at max - Experiment: AI will try to capture Mines and Dwellings when there are no enemies around (part of CONQUER goal)
This commit is contained in:
@ -1940,6 +1940,8 @@ std::set<const CStack*> CBattleInfoCallback::getAffectedCreatures(const CSpell *
|
||||
{
|
||||
possibleHexes.erase (hex); //can't hit same place twice
|
||||
}
|
||||
if (!possibleHexes.size()) //not enough targets
|
||||
break;
|
||||
lightningHex = BattleHex::getClosestTile (attackerOwner, destinationTile, possibleHexes);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user