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:
@@ -32,14 +32,16 @@ namespace PathfinderUtil
|
|||||||
case ELayer::LAND:
|
case ELayer::LAND:
|
||||||
case ELayer::SAIL:
|
case ELayer::SAIL:
|
||||||
if(tinfo.visitable())
|
if(tinfo.visitable())
|
||||||
|
{
|
||||||
|
if (tinfo.visitableObjects.size() > 1)
|
||||||
{
|
{
|
||||||
auto frontVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
auto frontVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
||||||
auto backVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.front());
|
auto backVisitable = gameInfo.getObjInstance(tinfo.visitableObjects.back());
|
||||||
|
if(frontVisitable->ID == Obj::SANCTUARY && backVisitable->ID == Obj::HERO && backVisitable->getOwner() != player)
|
||||||
if(frontVisitable->ID == Obj::SANCTUARY && backVisitable->ID == Obj::HERO && backVisitable->getOwner() != player) //non-owned hero stands on Sanctuary
|
|
||||||
{
|
{
|
||||||
return EPathAccessibility::BLOCKED;
|
return EPathAccessibility::BLOCKED;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool hasBlockedVisitable = false;
|
bool hasBlockedVisitable = false;
|
||||||
|
Reference in New Issue
Block a user