From 9f42fdefe890241e056ee7f46ebbc8b3592eff11 Mon Sep 17 00:00:00 2001 From: MysticalOS Date: Thu, 3 Oct 2019 16:02:09 -0400 Subject: [PATCH] Fix Temple of Kotmogu, which never would have worked at all, do to bad code logic. --- DBM-PvP/PvPGeneral.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/DBM-PvP/PvPGeneral.lua b/DBM-PvP/PvPGeneral.lua index 006357e..1a701b1 100644 --- a/DBM-PvP/PvPGeneral.lua +++ b/DBM-PvP/PvPGeneral.lua @@ -339,7 +339,8 @@ do function mod:AREA_POIS_UPDATED(widget) local allyBases, hordeBases = 0, 0 - if subscribedMapID ~= 0 and widget and widget.widgetID == 1671 then + local widgetID = widget and widget.widgetID + if subscribedMapID ~= 0 and widgetID and widgetID == 1671 then local isAtlas = false for _, areaPOIID in ipairs(C_AreaPoiInfo.GetAreaPOIForMap(subscribedMapID)) do local areaPOIInfo = C_AreaPoiInfo.GetAreaPOIInfo(subscribedMapID, areaPOIID) @@ -393,7 +394,7 @@ do end end end - elseif widget and widget.widgetID == 1683 then + elseif widgetID and widgetID == 1683 then local widgetInfo = C_UIWidgetManager.GetDoubleStateIconRowVisualizationInfo(1683) for _, v in pairs(widgetInfo.leftIcons) do if v.iconState == 1 then @@ -408,8 +409,10 @@ do else return end - local info = C_UIWidgetManager.GetDoubleStatusBarWidgetVisualizationInfo(1671) - self:UpdateWinTimer(info.leftBarMax, info.leftBarValue, info.rightBarValue, allyBases, hordeBases) + local info = C_UIWidgetManager.GetDoubleStatusBarWidgetVisualizationInfo(widgetID) + if info then + self:UpdateWinTimer(info.leftBarMax, info.leftBarValue, info.rightBarValue, allyBases, hordeBases) + end end mod.UPDATE_UI_WIDGET = mod.AREA_POIS_UPDATED end