فهرست منبع

Block pathfinder from allowing to interact with heroes standing on
another visitable object

Ivan Savenko 8 ماه پیش
والد
کامیت
7823dd3945
1فایلهای تغییر یافته به همراه13 افزوده شده و 5 حذف شده
  1. 13 5
      lib/pathfinder/PathfinderUtil.h

+ 13 - 5
lib/pathfinder/PathfinderUtil.h

@@ -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())