Skip to content

Commit

Permalink
Fixed iterator issue
Browse files Browse the repository at this point in the history
Fixed divide by zero issue
  • Loading branch information
imevul committed Aug 3, 2024
1 parent e3f12ec commit 62a7351
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local _, NS = ...
local MODULE_NAME, MODULE_VERSION = 'Attunement', 5
local MODULE_NAME, MODULE_VERSION = 'Attunement', 6

NS.DebugLog(MODULE_NAME, MODULE_VERSION, 'Start')
if not NS.loaded then return end
Expand Down Expand Up @@ -119,7 +119,7 @@ function SynastriaCoreLib.HasAttuneProgress(itemIdOrLink)
end

function SynastriaCoreLib.InProgressItems()
if not SynastriaCoreLib.isLoaded() then return nil, nil end
if not SynastriaCoreLib.isLoaded() then return function() end, nil end

local nxt, t, r = SynastriaCoreLib.AllCustomGameData(
SynastriaCoreLib.CustomDataTypes.ATTUNE_HAS,
Expand Down
4 changes: 2 additions & 2 deletions src/SynastriaCoreLib/SynastriaCoreLib-1.0/Modules/LDB.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local _, NS = ...
local MODULE_NAME, MODULE_VERSION = 'LDB', 5
local MODULE_NAME, MODULE_VERSION = 'LDB', 6

NS.DebugLog(MODULE_NAME, MODULE_VERSION, 'Start')
if not NS.loaded then return end
Expand Down Expand Up @@ -39,7 +39,7 @@ local function GetTopInProgress(maxNum)
if count >= maxNum then break end
end

return ret, ('%d %%'):format(total / count), count
return ret, ('%d %%'):format(total / math.max(1, count)), count
end

local function GetActiveTasks(maxNum)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local wowAddonName, NS = ...
local SYNASTRIACORELIB_MAJOR, SYNASTRIACORELIB_MINOR = 'SynastriaCoreLib-1.0', 16
local SYNASTRIACORELIB_MAJOR, SYNASTRIACORELIB_MINOR = 'SynastriaCoreLib-1.0', 17
NS.SYNASTRIACORELIB_MINOR = SYNASTRIACORELIB_MINOR

if not SCL then SCL = {} end
Expand Down Expand Up @@ -297,7 +297,7 @@ function SynastriaCoreLib.PlayerIsRaceMask(raceMask)
end

function SynastriaCoreLib.AllCustomGameData(typeId, filterFnc)
if not SynastriaCoreLib.isLoaded() then return nil, nil end
if not SynastriaCoreLib.isLoaded() then return function() end, nil end

local index = nil
local count = GetCustomGameDataCount(typeId)
Expand Down
2 changes: 1 addition & 1 deletion src/SynastriaCoreLib/SynastriaCoreLib.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: SynastriaCoreLib-1.0
## Notes: A library of functions from Synastria
## Author: Imevul, meh321
## Version: 1.0.16-Release
## Version: 1.0.17-Release
## X-Category: Imevul

#@no-lib-strip@
Expand Down

0 comments on commit 62a7351

Please sign in to comment.