mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
AI: fix freeze when AI has a win condition to control own town
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user