mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Nullkiller: fixes for partly visible objs
This commit is contained in:
parent
28b77e0b79
commit
1d561b9882
@ -157,7 +157,10 @@ bool CaptureObjectsBehavior::shouldVisitObject(ObjectIdRef obj) const
|
||||
//it may be hero visiting this obj
|
||||
//we don't try visiting object on which allied or owned hero stands
|
||||
// -> it will just trigger exchange windows and AI will be confused that obj behind doesn't get visited
|
||||
const CGObjectInstance * topObj = cb->getTopObj(obj->visitablePos());
|
||||
const CGObjectInstance * topObj = cb->getTopObj(pos);
|
||||
|
||||
if(!topObj)
|
||||
return false; // partly visible obj but its visitable pos is not visible.
|
||||
|
||||
if(topObj->ID == Obj::HERO && cb->getPlayerRelations(ai->playerID, topObj->tempOwner) != PlayerRelations::ENEMIES)
|
||||
return false;
|
||||
|
@ -61,6 +61,8 @@ void Nullkiller::resetAiState()
|
||||
|
||||
void Nullkiller::updateAiState()
|
||||
{
|
||||
ai->validateVisitableObjs();
|
||||
|
||||
// TODO: move to hero manager
|
||||
auto activeHeroes = ai->getMyHeroes();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user