1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

HAS_CHARGES_LIMITER

This commit is contained in:
SoundSSGood
2025-05-20 16:29:14 +02:00
parent b6f1eac19b
commit 6752ab3a75
20 changed files with 136 additions and 78 deletions

View File

@@ -641,6 +641,16 @@ std::shared_ptr<const ILimiter> JsonUtils::parseLimiter(const JsonNode & limiter
}
return hexLimiter;
}
else if(limiterType == "HAS_CHARGES_LIMITER")
{
auto hasChargesLimiter = std::make_shared<HasChargesLimiter>();
if(!parameters.Vector().empty())
{
if(parameters.Vector().size() == 1 && parameters.Vector().front().isNumber())
hasChargesLimiter->chargeCost = parameters.Vector().front().Integer();
}
return hasChargesLimiter;
}
else
{
logMod->error("Error: invalid customizable limiter type %s.", limiterType);