Skip to content

Commit

Permalink
Fixed a bug where spell list entries with just integers caused the sp…
Browse files Browse the repository at this point in the history
…ell list to become inaccessible. GH-97
  • Loading branch information
Dicebar committed Sep 19, 2024
1 parent 5a97c5d commit 91f1461
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 19 September 2024
- Fixed a bug with empty spellbook tabs.
- Fixed a bug where spell list entries with just integers caused the spell list to become inaccessible.

# 12 September 2024
- Fixed the mounted condition not recognizing druids' flight and travel forms.
Expand Down
26 changes: 24 additions & 2 deletions Raven_Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,30 @@ local function ValidateSpellName(name, allowPlusIDs, warnings)
end

-- Return a sorted list suitable for an input selection widget
local function GetSortedList(list) local i, t = 0, {}; if list then for n in pairs(list) do i = i + 1; t[i] = n end end; table.sort(t); return t end
local function GetSortedListEntry(list, n) for i, k in pairs(GetSortedList(list)) do if n == k then return i end end return nil end
local function GetSortedList(list)
local i, t = 0, {};

if list then
for n in pairs(list) do
i = i + 1
t[i] = tostring(n) -- Pure digits are stored as an int. Force to string to prevent lua errors.
end
end

table.sort(t)

return t
end

local function GetSortedListEntry(list, n)
for i, k in pairs(GetSortedList(list)) do
if n == k then
return i
end
end

return nil
end

local function CheckListEntry(list, n)
if n then return n end
Expand Down

0 comments on commit 91f1461

Please sign in to comment.