Added sorting to the modded bag of crafting itempool generator
This commit is contained in:
1 parent
75610f2cab
commit
2764d677f5
1 file changed
+9
-1
@@ -509,11 +509,19 @@ local function GameStartCrafting()
|
|||||||
for i=1,EID.XMLMaxItemID do itemPool:AddRoomBlacklist(i) end
|
for i=1,EID.XMLMaxItemID do itemPool:AddRoomBlacklist(i) end
|
||||||
|
|
||||||
local collID = itemPool:GetCollectible(poolNum, false, 1, 25)
|
local collID = itemPool:GetCollectible(poolNum, false, 1, 25)
|
||||||
|
local idsToAdd = {}
|
||||||
while collID ~= 25 do
|
while collID ~= 25 do
|
||||||
table.insert(CraftingItemPools[poolNum+1], {collID, 1.0})
|
table.insert(idsToAdd, {collID, 1.0})
|
||||||
itemPool:AddRoomBlacklist(collID)
|
itemPool:AddRoomBlacklist(collID)
|
||||||
collID = itemPool:GetCollectible(poolNum, false, 1, 25)
|
collID = itemPool:GetCollectible(poolNum, false, 1, 25)
|
||||||
end
|
end
|
||||||
|
-- sort ids since thats the most likely way people add items to the itempool
|
||||||
|
table.sort(idsToAdd, function (a,b)
|
||||||
|
return a[1] < b[1]
|
||||||
|
end)
|
||||||
|
for _,v in ipairs(idsToAdd) do
|
||||||
|
table.insert(CraftingItemPools[poolNum+1], v)
|
||||||
|
end
|
||||||
|
|
||||||
itemPool:ResetRoomBlacklist()
|
itemPool:ResetRoomBlacklist()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user