Explorar o código

Fix negative spell cost

nordsoft %!s(int64=2) %!d(string=hai) anos
pai
achega
16b147d588
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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