mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-17 20:58:07 +02:00
Block pathfinder from allowing to interact with heroes standing on
another visitable object
This commit is contained in:
parent
436aa0a15f
commit
7823dd3945
@ -40,15 +40,23 @@ namespace PathfinderUtil
|
||||
}
|
||||
else
|
||||
{
|
||||
bool hasBlockedVisitable = false;
|
||||
bool hasVisitable = false;
|
||||
|
||||
for(const CGObjectInstance * obj : tinfo.visitableObjects)
|
||||
{
|
||||
if(obj->isBlockedVisitable())
|
||||
return EPathAccessibility::BLOCKVIS;
|
||||
else if(obj->passableFor(player))
|
||||
return EPathAccessibility::ACCESSIBLE;
|
||||
else if(obj->ID != Obj::EVENT)
|
||||
return EPathAccessibility::VISITABLE;
|
||||
hasBlockedVisitable = true;
|
||||
else if(!obj->passableFor(player) && obj->ID != Obj::EVENT)
|
||||
hasVisitable = true;
|
||||
}
|
||||
|
||||
if(hasBlockedVisitable)
|
||||
return EPathAccessibility::BLOCKVIS;
|
||||
if(hasVisitable)
|
||||
return EPathAccessibility::VISITABLE;
|
||||
|
||||
return EPathAccessibility::ACCESSIBLE;
|
||||
}
|
||||
}
|
||||
else if(tinfo.blocked())
|
||||
|
Loading…
x
Reference in New Issue
Block a user