mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-17 11:56:46 +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)
|
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()));
|
return sptr (Goals::GetObj(goal.object->id.getNum()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user