瀏覽代碼

Default object limit to unlimited

Tomasz Zieliński 1 年之前
父節點
當前提交
55e2a99154
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lib/rmg/ObjectConfig.cpp

+ 6 - 0
lib/rmg/ObjectConfig.cpp

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