1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

HasChargesLimiter now works in "bonuses" json section

This commit is contained in:
SoundSSGood
2025-06-24 01:23:07 +02:00
parent 7f9936cf10
commit 76debab846
7 changed files with 35 additions and 37 deletions

View File

@@ -4346,7 +4346,7 @@ void CGameHandler::useChargeBasedSpell(const ObjectInstanceID & heroObjectID, co
{
const auto * artType = artInst->getType();
const auto spellCost = artType->getChargeCost(spellID);
if(spellCost.has_value() && artType->getDischargeCondition()== DischargeArtifactCondition::SPELLCAST)
if(spellCost.has_value() && spellCost.value() <= artInst->getCharges() && artType->getDischargeCondition() == DischargeArtifactCondition::SPELLCAST)
{
chargedArt.emplace(hero->getArtPos(artInst), artInst->getId(), spellCost.value());
}