diff --git a/IceCore.lua b/IceCore.lua index 82d1985..0e304ef 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -848,7 +848,11 @@ end function IceCore.prototype:RequestUpdates(module, func) if self.updatees[module] ~= func then - self.updatees[module] = func + -- Parnic: this prevents modules who are handling their own updates (as opposed to relying on IceBarElement) + -- from having their update request yanked out from under them. + if func ~= nil or not module.handlesOwnUpdates then + self.updatees[module] = func + end end local count = 0 diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index f78fb98..3508519 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -72,9 +72,11 @@ function IceCustomBar.prototype:ConditionalSubscribe() self.CustomBarUpdateFunc = function() self:UpdateCustomBar() end end + self.handlesOwnUpdates = true IceHUD.IceCore:RequestUpdates(self, self.CustomBarUpdateFunc) end else + self.handlesOwnUpdates = false IceHUD.IceCore:RequestUpdates(self, nil) end end @@ -700,6 +702,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate) self.UpdateCustomBarFunc = function() self:UpdateCustomBar(self.unit, true) end end + self.handlesOwnUpdates = true IceHUD.IceCore:RequestUpdates(self, self.UpdateCustomBarFunc) end @@ -718,6 +721,7 @@ function IceCustomBar.prototype:UpdateCustomBar(unit, fromUpdate) self:UpdateBar(0, "undef") self:Show(false) if not self:ShouldAlwaysSubscribe() then + self.handlesOwnUpdates = false IceHUD.IceCore:RequestUpdates(self, nil) end end diff --git a/modules/CustomCDBar.lua b/modules/CustomCDBar.lua index c4b28fd..a62cca8 100644 --- a/modules/CustomCDBar.lua +++ b/modules/CustomCDBar.lua @@ -521,6 +521,8 @@ function IceCustomCDBar.prototype:EnableUpdates(enable_update) -- end end + self.handlesOwnUpdates = enable_update + if enable_update then if not self.CustomUpdateFunc then self.CustomUpdateFunc = function() self:UpdateCustomBar(true) end