Browse Source

Fixed creature specialties

Ivan Savenko 2 years ago
parent
commit
4015d3d8bd
1 changed files with 7 additions and 7 deletions
  1. 7 7
      lib/HeroBonus.cpp

+ 7 - 7
lib/HeroBonus.cpp

@@ -1971,13 +1971,13 @@ JsonNode ILimiter::toJsonNode() const
 
 int CCreatureTypeLimiter::limit(const BonusLimitationContext &context) const
 {
-	const CCreature *c = retrieveCreature(&context.node);
-	if(!c)
-		return true;
-	return c != creature   &&   (!includeUpgrades || !creature->isMyUpgrade(c));
-	//drop bonus if it's not our creature and (we don`t check upgrades or its not our upgrade)
-}
-
+	const CCreature *c = retrieveCreature(&context.node);
+	if(!c)
+		return true;
+	return c->getId() != creature->getId() && (!includeUpgrades || !creature->isMyUpgrade(c));
+	//drop bonus if it's not our creature and (we don`t check upgrades or its not our upgrade)
+}
+
 CCreatureTypeLimiter::CCreatureTypeLimiter(const CCreature & creature_, bool IncludeUpgrades)
 	: creature(&creature_), includeUpgrades(IncludeUpgrades)
 {