Browse Source

Merge pull request #3273 from vcmi/fix_passable_hero

Fix passable hero
Ivan Savenko 1 year ago
parent
commit
933598dd91
2 changed files with 6 additions and 1 deletions
  1. 5 1
      lib/mapObjects/CGHeroInstance.cpp
  2. 1 0
      lib/mapObjects/CGHeroInstance.h

+ 5 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -150,6 +150,11 @@ bool CGHeroInstance::isCoastVisitable() const
 	return true;
 }
 
+bool CGHeroInstance::isBlockedVisitable() const
+{
+	return true;
+}
+
 BattleField CGHeroInstance::getBattlefield() const
 {
 	return BattleField::NONE;
@@ -280,7 +285,6 @@ CGHeroInstance::CGHeroInstance():
 	setNodeType(HERO);
 	ID = Obj::HERO;
 	secSkills.emplace_back(SecondarySkill::NONE, -1);
-	blockVisit = true;
 }
 
 PlayerColor CGHeroInstance::getOwner() const

+ 1 - 0
lib/mapObjects/CGHeroInstance.h

@@ -301,6 +301,7 @@ public:
 	void updateFrom(const JsonNode & data) override;
 
 	bool isCoastVisitable() const override;
+	bool isBlockedVisitable() const override;
 	BattleField getBattlefield() const override;
 protected:
 	void setPropertyDer(ObjProperty what, ObjPropertyID identifier) override;//synchr