Prevent taint in UpdateAction

This commit is contained in:
Hendrik Leppkes
2008-11-09 15:46:50 +01:00
parent 170b8253cd
commit 293e41b7d2
+5 -14
View File
@@ -262,9 +262,6 @@ function Button:Update()
end
function Button:UpdateAction(force)
if force then
self.action = 0
end
ActionButton_UpdateAction(self)
end
@@ -276,7 +273,7 @@ function Button:ToggleButtonElements()
end
end
local orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys
orig_ActionButton_UpdateHotkeys = ActionButton_UpdateHotkeys
ActionButton_UpdateHotkeys = function(self, ...)
local name = self:GetName()
if name and name:find("^BT4Button") then
@@ -360,17 +357,11 @@ function Button:GetActionName()
return format(actionTmpl, self.parent.id, self.rid)
end
local orig_ActionButton_UpdateUsable = ActionButton_UpdateUsable
ActionButton_UpdateUsable = function(self, ...)
local name = self:GetName()
if name and name:find("^BT4Button") then
if self.BT4init then
self:UpdateUsable()
end
else
orig_ActionButton_UpdateUsable(self, ...)
hooksecurefunc("ActionButton_UpdateUsable", function(self)
if self.BT4init then
self:UpdateUsable()
end
end
end)
function Button:UpdateUsable(force)
local isUsable, notEnoughMana = IsUsableAction(self.action)