mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Hero try to execute a quest to kill himself
This commit is contained in:
parent
ff75e5e6e8
commit
3871ed0085
@ -2469,7 +2469,6 @@ Goals::TSubgoal VCAI::questToGoal(const QuestInfo & q)
|
|||||||
}
|
}
|
||||||
return sptr(Goals::FindObj(Obj::PRISON)); //rule of a thumb - quest heroes usually are locked in prisons
|
return sptr(Goals::FindObj(Obj::PRISON)); //rule of a thumb - quest heroes usually are locked in prisons
|
||||||
//BNLOG ("Don't know how to recruit hero with id %d\n", q.quest->m13489val);
|
//BNLOG ("Don't know how to recruit hero with id %d\n", q.quest->m13489val);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case CQuest::MISSION_ARMY:
|
case CQuest::MISSION_ARMY:
|
||||||
{
|
{
|
||||||
@ -2513,12 +2512,28 @@ Goals::TSubgoal VCAI::questToGoal(const QuestInfo & q)
|
|||||||
case CQuest::MISSION_KILL_CREATURE:
|
case CQuest::MISSION_KILL_CREATURE:
|
||||||
{
|
{
|
||||||
auto obj = cb->getObjByQuestIdentifier(q.quest->m13489val);
|
auto obj = cb->getObjByQuestIdentifier(q.quest->m13489val);
|
||||||
if (obj)
|
|
||||||
return sptr(Goals::VisitObj(obj->id.getNum()));
|
if(!obj)
|
||||||
else
|
|
||||||
return sptr(Goals::VisitObj(q.obj->id.getNum())); //visit seer hut
|
return sptr(Goals::VisitObj(q.obj->id.getNum())); //visit seer hut
|
||||||
|
|
||||||
|
if(obj->ID == Obj::HERO)
|
||||||
|
{
|
||||||
|
auto relations = myCb->getPlayerRelations(playerID, obj->tempOwner);
|
||||||
|
|
||||||
|
if(relations == PlayerRelations::SAME_PLAYER)
|
||||||
|
{
|
||||||
|
auto heroToProtect = cb->getHero(obj->id);
|
||||||
|
|
||||||
|
return sptr(Goals::GatherArmy().sethero(heroToProtect));
|
||||||
|
}
|
||||||
|
else if(relations == PlayerRelations::ALLIES)
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sptr(Goals::VisitObj(obj->id.getNum()));
|
||||||
|
}
|
||||||
case CQuest::MISSION_PRIMARY_STAT:
|
case CQuest::MISSION_PRIMARY_STAT:
|
||||||
{
|
{
|
||||||
auto heroes = cb->getHeroesInfo();
|
auto heroes = cb->getHeroesInfo();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user