mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +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
|
else
|
||||||
{
|
{
|
||||||
|
bool hasBlockedVisitable = false;
|
||||||
|
bool hasVisitable = false;
|
||||||
|
|
||||||
for(const CGObjectInstance * obj : tinfo.visitableObjects)
|
for(const CGObjectInstance * obj : tinfo.visitableObjects)
|
||||||
{
|
{
|
||||||
if(obj->isBlockedVisitable())
|
if(obj->isBlockedVisitable())
|
||||||
return EPathAccessibility::BLOCKVIS;
|
hasBlockedVisitable = true;
|
||||||
else if(obj->passableFor(player))
|
else if(!obj->passableFor(player) && obj->ID != Obj::EVENT)
|
||||||
return EPathAccessibility::ACCESSIBLE;
|
hasVisitable = true;
|
||||||
else if(obj->ID != Obj::EVENT)
|
|
||||||
return EPathAccessibility::VISITABLE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hasBlockedVisitable)
|
||||||
|
return EPathAccessibility::BLOCKVIS;
|
||||||
|
if(hasVisitable)
|
||||||
|
return EPathAccessibility::VISITABLE;
|
||||||
|
|
||||||
|
return EPathAccessibility::ACCESSIBLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(tinfo.blocked())
|
else if(tinfo.blocked())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user