1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Nullkiller: defence behavior

This commit is contained in:
Andrii Danylchenko
2021-05-16 13:53:32 +03:00
committed by Andrii Danylchenko
parent f44c3f2aaf
commit a2ac19e4ec
8 changed files with 238 additions and 3 deletions

View File

@@ -484,9 +484,17 @@ void AINodeStorage::setHeroes(std::vector<HeroPtr> heroes, const VCAI * _ai)
for(auto & hero : heroes)
{
uint64_t mask = 1 << actors.size();
auto actor = std::make_shared<HeroActor>(hero.get(), mask, ai);
if(hero->tempOwner != ai->playerID)
{
bool onLand = !actor->hero->boat;
actor->initialMovement = actor->hero->maxMovePoints(onLand);
}
playerID = hero->tempOwner;
actors.push_back(std::make_shared<HeroActor>(hero.get(), mask, ai));
actors.push_back(actor);
}
}