1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #518 from nullkiller/freeze-on-control-own-town-win-condition

AI: fix freeze when AI has a win condition  to control own town
This commit is contained in:
Alexander Shishkin 2018-11-07 09:42:25 +03:00 committed by GitHub
commit ec53f52ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,7 +422,17 @@ TSubgoal Win::whatToDoToAchieve()
{
if(goal.object)
{
return sptr(Goals::VisitObj(goal.object->id.getNum()));
auto objRelations = cb->getPlayerRelations(ai->playerID, goal.object->tempOwner);
if(objRelations == PlayerRelations::ENEMIES)
{
return sptr(Goals::VisitObj(goal.object->id.getNum()));
}
else
{
// TODO: Defance
break;
}
}
else
{