Browse Source

Fix negative spell cost

nordsoft 2 years ago
parent
commit
16b147d588
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/battle/CBattleInfoCallback.cpp

+ 1 - 1
lib/battle/CBattleInfoCallback.cpp

@@ -1573,7 +1573,7 @@ int32_t CBattleInfoCallback::battleGetSpellCost(const spells::Spell * sp, const
 		}
 	}
 
-	return ret - manaReduction + manaIncrease;
+	return std::max(0, ret - manaReduction + manaIncrease);
 }
 
 bool CBattleInfoCallback::battleHasShootingPenalty(const battle::Unit * shooter, BattleHex destHex) const