Quantcast
WoWInterface - View Single Post - Error when using GetMapInfo
View Single Post
08-25-18, 03:44 PM   #5
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 368
Since both cases are basically identical in how they are handled:
Code:
function private_table.eventFrame:UI_INFO_MESSAGE(messageType)
    local dbKey
    if messageType == 371 then      -- New Area
        dbKey = "Area"
    elseif messageType == 280 then  -- New Taxi Path
        dbKey = "Taxi"
    end
    if dbKey then
        local mapID = C_Map.GetBestMapForUnit('player')
        if mapID then
            addon:Check_Dates()
            local continentInfo = MapUtil.GetMapParentInfo(mapID, Enum.UIMapType.Continent, true)
            local data = {
                time        = time(),
                continent   = continentInfo.name,
                zoneName    = GetZoneText(),
                subzoneName = GetSubZoneText()
            }
            table.insert(HistoriaLocalDb[dbKey], data)
            table.insert(HistoriaLocalDb.Dates[addon.YS][addon.MS][addon.DS][dbKey], data)
        end
    end
end
I just guessed that addon:Check_Dates() only needed to run when saving data so move it if needed.
  Reply With Quote