Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,20 @@ function calcs.perform(env, skipEHP)
end
end

local slotIndex = env.itemSlotIndex or { }
local orderedFlasks = { }
for item in pairs(flasks) do
t_insert(orderedFlasks, item)
end
table.sort(orderedFlasks, function(a, b)
local posA = slotIndex[a] or 0
local posB = slotIndex[b] or 0
if posA ~= posB then
return posA < posB
end
return (a.id or 0) < (b.id or 0)
end)
for _, item in ipairs(orderedFlasks) do
flaskBuffsPerBase[item.baseName] = flaskBuffsPerBase[item.baseName] or {}
flaskBuffsPerBaseNonPlayer[item.baseName] = flaskBuffsPerBaseNonPlayer[item.baseName] or {}
local instantPerc = getFlaskInstantRecovery(item)
Expand Down Expand Up @@ -1902,7 +1915,20 @@ function calcs.perform(env, skipEHP)
mergeBuff(srcList, tinctureBuffsPerBase[item.baseName], key)
end
end
local slotIndex = env.itemSlotIndex or { }
local orderedTinctures = { }
for item in pairs(tinctures) do
t_insert(orderedTinctures, item)
end
table.sort(orderedTinctures, function(a, b)
local posA = slotIndex[a] or 0
local posB = slotIndex[b] or 0
if posA ~= posB then
return posA < posB
end
return (a.id or 0) < (b.id or 0)
end)
for _, item in ipairs(orderedTinctures) do
if tinctureLimit <= 0 then
break
end
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1019,12 +1019,16 @@ function calcs.initEnv(build, mode, override, specEnv)
end
end

env.itemSlotIndex = { }
-- Track which flask slot (1-5) each flask is in, for adjacency checks
env.flaskSlotMap = { }
env.flaskSlotOccupied = { }
for _, slot in ipairs(build.itemsTab.orderedSlots) do
local slotName = slot.slotName
local item = items[slotName]
if item then
env.itemSlotIndex[item] = tonumber(slotName:match("%d+")) or 0
end
if item and item.type == "Flask" then
env.itemModDB.conditions["Have"..item.baseName:gsub("%s+", "")] = true
if slot.active then
Expand Down
Loading