Maximum shield amount using max hp but not updating on UNIT_MAXHEALTH #1089


  • Accepted
Closed
  • Surarn created this issue Jul 8, 2022

    Hey

     

    As i mentioned in the title, having maximum shield amount set to 0 so it uses max health causes some weird interactions when its not set to update when the units max health changes. Solved it by changing the following.

     

    function Shields:OnEnable()
    	self:UpdateDB()
    	self:RegisterEvent("UNIT_ABSORB_AMOUNT_CHANGED", "UpdateUnit")
    	self:RegisterEvent("UNIT_MAXHEALTH", "UpdateUnit")
    end
    
    function Shields:OnDisable()
    	self:UnregisterEvent("UNIT_ABSORB_AMOUNT_CHANGED")
    	self:UnregisterEvent("UNIT_MAXHEALTH")
    end
    
    function Shields:UpdateUnit(_,unit)
    	self:UpdateIndicators(unit)
    end

     

     

  • michaelsp added a tag Accepted Jul 10, 2022
  • Surarn closed issue Sep 2, 2022

To post a comment, please login or register a new account.