mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
AiI will ignore winning conditions that require defeating his own objects. Fixes #2174
This commit is contained in:
parent
e45b6cfdda
commit
f3c7774576
@ -221,6 +221,12 @@ TSubgoal Win::whatToDoToAchieve()
|
||||
{
|
||||
if (goal.object)
|
||||
{
|
||||
auto obj = cb->getObj (goal.object->id);
|
||||
if (obj)
|
||||
if (obj->getOwner() == ai->playerID) //we can't capture our own object
|
||||
return sptr(Goals::Conquer());
|
||||
|
||||
|
||||
return sptr (Goals::GetObj(goal.object->id.getNum()));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user