Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix socketed gems calculation and add socket limit warning #6937

Merged
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
5 changes: 5 additions & 0 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1460,6 +1460,11 @@ function buildMode:InsertItemWarnings()
InsertIfNew(self.controls.warnings.lines, "You are exceeding jewel limit with the jewel "..warning)
end
end
if self.calcsTab.mainEnv.itemWarnings.socketLimitWarning then
for _, warning in ipairs(self.calcsTab.mainEnv.itemWarnings.socketLimitWarning) do
InsertIfNew(self.controls.warnings.lines, "You have too many gems in your "..warning.." slot")
end
end
end

-- Build list of side bar stats
Expand Down
7 changes: 6 additions & 1 deletion src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ function calcs.initEnv(build, mode, override, specEnv)
local socketedGems = 0
-- Loop through socket groups to calculate number of socketed gems
for _, socketGroup in pairs(env.build.skillsTab.socketGroupList) do
if (socketGroup.enabled and socketGroup.slot and socketGroup.slot == slotName and socketGroup.gemList) then
if (not socketGroup.source and socketGroup.enabled and socketGroup.slot and socketGroup.slot == slotName and socketGroup.gemList) then
for _, gem in pairs(socketGroup.gemList) do
if (gem.gemData and gem.enabled) then
socketedGems = socketedGems + 1
Expand All @@ -1017,6 +1017,11 @@ function calcs.initEnv(build, mode, override, specEnv)
env.itemModDB.multipliers.EmptyGreenSocketsInAnySlot = (env.itemModDB.multipliers.EmptyGreenSocketsInAnySlot or 0) + slotEmptySocketsCount.G
env.itemModDB.multipliers.EmptyBlueSocketsInAnySlot = (env.itemModDB.multipliers.EmptyBlueSocketsInAnySlot or 0) + slotEmptySocketsCount.B
env.itemModDB.multipliers.EmptyWhiteSocketsInAnySlot = (env.itemModDB.multipliers.EmptyWhiteSocketsInAnySlot or 0) + slotEmptySocketsCount.W
-- Warn if socketed gems over socket limit
if socketedGems > slotGemSocketsCount then
env.itemWarnings.socketLimitWarning = env.itemWarnings.socketLimitWarning or { }
t_insert(env.itemWarnings.socketLimitWarning, slotName)
end
end
end
end
Expand Down