mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Merge pull request #5931 from Opuszek/fix_sanctuary
fixes sanctuary behavior
This commit is contained in:
@@ -33,12 +33,14 @@ namespace PathfinderUtil
|
||||
case ELayer::SAIL:
|
||||
if(tinfo.visitable())
|
||||
{
|
||||
auto frontVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
||||
auto backVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
||||
|
||||
if(frontVisitable->ID == Obj::SANCTUARY && backVisitable->ID == Obj::HERO && backVisitable->getOwner() != player) //non-owned hero stands on Sanctuary
|
||||
if (tinfo.visitableObjects.size() > 1)
|
||||
{
|
||||
return EPathAccessibility::BLOCKED;
|
||||
auto frontVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
||||
auto backVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.back());
|
||||
if(frontVisitable->ID == Obj::SANCTUARY && backVisitable->ID == Obj::HERO && backVisitable->getOwner() != player)
|
||||
{
|
||||
return EPathAccessibility::BLOCKED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user