Browse Source

Backport hypnotize fix

Ivan Savenko 8 months ago
parent
commit
87975e4ac6
2 changed files with 3 additions and 2 deletions
  1. 1 0
      ChangeLog.md
  2. 2 2
      lib/battle/CUnitState.cpp

+ 1 - 0
ChangeLog.md

@@ -14,6 +14,7 @@
 
 ### General
 
+* Fixed not working check for hypnotize spell effect presence
 * Fixed calculation of the total cost of the hero's movement path when the hero has spent some of his movement points today.
 * Fixed Launcher not closing after game start on Mac OS.
 * Launcher will no longer tracks clipboard state on mobile systems to prevent OS notifications

+ 2 - 2
lib/battle/CUnitState.cpp

@@ -698,12 +698,12 @@ BattlePhases::Type CUnitState::battleQueuePhase(int turn) const
 
 bool CUnitState::isHypnotized() const
 {
-	return bonusCache.getBonusValue(UnitBonusValuesProxy::HYPNOTIZED);
+	return bonusCache.hasBonus(UnitBonusValuesProxy::HYPNOTIZED);
 }
 
 bool CUnitState::isInvincible() const
 {
-	return bonusCache.getBonusValue(UnitBonusValuesProxy::INVINCIBLE);
+	return bonusCache.hasBonus(UnitBonusValuesProxy::INVINCIBLE);
 }
 
 int CUnitState::getTotalAttacks(bool ranged) const