1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-10 00:43:59 +02:00

Default object limit to unlimited

This commit is contained in:
Tomasz Zieliński 2024-09-21 13:36:51 +02:00
parent ec603f46ae
commit 55e2a99154

View File

@ -145,9 +145,15 @@ void ObjectConfig::serializeJson(JsonSerializeFormat & handler)
// TODO: Use common code with default rmg config // TODO: Use common code with default rmg config
auto objectValue = rmg["value"].Integer(); auto objectValue = rmg["value"].Integer();
auto objectProbability = rmg["rarity"].Integer(); auto objectProbability = rmg["rarity"].Integer();
auto objectMaxPerZone = rmg["zoneLimit"].Integer(); auto objectMaxPerZone = rmg["zoneLimit"].Integer();
if (objectMaxPerZone == 0)
{
objectMaxPerZone = std::numeric_limits<int>::max();
}
VLC->objtypeh->resolveObjectCompoundId(objectName, VLC->objtypeh->resolveObjectCompoundId(objectName,
[this, objectValue, objectProbability, objectMaxPerZone](CompoundMapObjectID objid) [this, objectValue, objectProbability, objectMaxPerZone](CompoundMapObjectID objid)
{ {
ObjectInfo object(objid.primaryID, objid.secondaryID); ObjectInfo object(objid.primaryID, objid.secondaryID);