Fix Lua 5.0 getn() crash on first guide load

GuideTable.lua:88 used the Lua 5.0 global getn() to size the color-
substitution table opentext. In Lua 5.1 (WoW 3.3.5) the bare getn is
gone and table.getn is deprecated, so this would have crashed with
'attempt to call global getn (a nil value)' before any guide could
render. Replaced with the # length operator.

Also record the fix and the upstream README cleanup under 'Files we
touched' in README-CoA.md.
This commit is contained in:
Florian Andrew George Berthold 2026-05-11 22:09:44 +02:00
parent d29ad39617
commit b96e1ce8b2
2 changed files with 10 additions and 1 deletions

View file

@ -85,7 +85,7 @@ function objGuideTable:new(oSettings)
["replace"] = "|c00a80000"
},
}
for n = 1, getn(opentext) do
for n = 1, #opentext do
t1[k1].items[k2].str = gsub(t1[k1].items[k2].str, opentext[n]["find"],opentext[n]["replace"])
end
t1[k1].items[k2].str = gsub(t1[k1].items[k2].str, "#","|r")