Release 4.6.1: tidy README, add changelog, stop forcing Nampower event CVars on 4.5.0+
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019W3rwwjHwAer9dAQAg4q7V
This commit is contained in:
+12
-4
@@ -315,10 +315,18 @@ parser:RegisterSource("nampower", {
|
||||
return "needs SuperWoW or ClassicAPI for GUID unit tokens"
|
||||
end,
|
||||
enable = function()
|
||||
-- auto attack and heal events are off by default in Nampower
|
||||
for _, cvar in pairs({ "NP_EnableAutoAttackEvents", "NP_EnableSpellHealEvents" }) do
|
||||
local ok, value = pcall(GetCVar, cvar)
|
||||
if ok and value == "0" then pcall(SetCVar, cvar, "1") end
|
||||
-- Auto attack and heal events are off by default in Nampower. From 4.5.0
|
||||
-- on, registering the event turns it on, so the saved CVars stay untouched.
|
||||
-- Older versions only know the CVars.
|
||||
local major, minor = 0, 0
|
||||
local ok, a, b = pcall(GetNampowerVersion)
|
||||
if ok then major, minor = tonumber(a) or 0, tonumber(b) or 0 end
|
||||
|
||||
if major < 4 or (major == 4 and minor < 5) then
|
||||
for _, cvar in pairs({ "NP_EnableAutoAttackEvents", "NP_EnableSpellHealEvents" }) do
|
||||
local ok, value = pcall(GetCVar, cvar)
|
||||
if ok and value == "0" then pcall(SetCVar, cvar, "1") end
|
||||
end
|
||||
end
|
||||
|
||||
for event in pairs(nampower) do
|
||||
|
||||
Reference in New Issue
Block a user