From 6e73725bdc19a68e3eb179832c14f2e1f4ed55fa Mon Sep 17 00:00:00 2001 From: p3lim-52096 Date: Wed, 21 Jan 2009 20:45:00 +0000 Subject: [PATCH] Fixed error on combat login Removed strict filtering git-svn-id: svn://svn.wowinterface.com/pError-161/trunk@12 7a612bb6-1b7b-4f5f-b58b-e1cc54d1b6b6 --- pError/pError.lua | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pError/pError.lua b/pError/pError.lua index 37d39d9..d9d16d6 100644 --- a/pError/pError.lua +++ b/pError/pError.lua @@ -7,6 +7,17 @@ local defaults = { [ERR_ABILITY_COOLDOWN] = true, } +local function OnEvent(self, event, ...) + if(event == 'UI_ERROR_MESSAGE') then + local str = ... + for k,v in pairs(pErrorDB) do + if(string.find(string.lower(str), string.lower(k)) and v) then return end + end + end + + return UIErrorsFrame_OnEvent(self, event, ...) +end + local function OnLoad(self, event, addon) if(addon ~= 'pError') then return end @@ -17,23 +28,13 @@ local function OnLoad(self, event, addon) end end - self:UnregisterEvent(event) -end - -local function OnEvent(self, event, ...) - if(event == 'UI_ERROR_MESSAGE') then - local str = ... - for k,v in pairs(pErrorDB) do - if(str == k and v) then return end - end - end + UIErrorsFrame:SetScript('OnEvent', OnEvent) - return UIErrorsFrame_OnEvent(self, event, ...) + self:UnregisterEvent(event) end addon:RegisterEvent('ADDON_LOADED') addon:SetScript('OnEvent', OnLoad) -UIErrorsFrame:SetScript('OnEvent', OnEvent) SLASH_PERROR1 = '/perror' SlashCmdList.PERROR = function(str) @@ -47,7 +48,7 @@ SlashCmdList.PERROR = function(str) end elseif(#str > 0) then for k,v in pairs(pErrorDB) do - if(k == str) then + if(string.find(string.lower(str), string.lower(k))) then pErrorDB[k] = not v print(format('|cffff8080pError:|r %s "%s"', v and '|cffff0000Disabled|r' or '|cff00ff00Enabled|r', k)) return -- 1.7.9.5