From f8c216ea0c13b42544ea0ad05e052bcc0af8a0ad Mon Sep 17 00:00:00 2001 From: Tercio Date: Wed, 28 Feb 2018 11:57:00 -0300 Subject: [PATCH] - Fix for ticket #333: error on the new dungeon chart recorder. --- boot.lua | 2 +- functions/dungeon.lua | 39 ++++++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/boot.lua b/boot.lua index 524b10a6..2cd65a24 100644 --- a/boot.lua +++ b/boot.lua @@ -3,7 +3,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 5351 + _detalhes.build_counter = 5355 _detalhes.userversion = "v7.3.5." .. _detalhes.build_counter _detalhes.realversion = 129 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" diff --git a/functions/dungeon.lua b/functions/dungeon.lua index e3e17c49..49429bae 100644 --- a/functions/dungeon.lua +++ b/functions/dungeon.lua @@ -165,27 +165,32 @@ function mythicDungeonCharts:OnBossDefeated() local currentCombat = Details:GetCurrentCombat() local segmentType = currentCombat:GetCombatType() local bossInfo = currentCombat:GetBossInfo() + local mythicLevel = C_ChallengeMode.GetActiveKeystoneInfo() - if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then + if (mythicLevel and mythicLevel > 0) then + if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then - local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) - tinsert (mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) - mythicDungeonCharts:Debug ("Boss defeated, time saved", currentCombat:GetCombatTime()) - else - if (mythicDungeonCharts.ChartTable.EndTime ~= -1) then - local now = time() - --check if the dungeon just ended - if (mythicDungeonCharts.ChartTable.EndTime + 2 >= now) then - - if (bossInfo) then - local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) - tinsert (mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) - mythicDungeonCharts:Debug ("Boss defeated, time saved, but used time aproximation:", mythicDungeonCharts.ChartTable.EndTime + 2, now, currentCombat:GetCombatTime()) - end - end + local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) + tinsert (mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) + mythicDungeonCharts:Debug ("Boss defeated, time saved", currentCombat:GetCombatTime()) else - mythicDungeonCharts:Debug ("Boss defeated, but no chart capture is running") + if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.EndTime ~= -1) then + local now = time() + --check if the dungeon just ended + if (mythicDungeonCharts.ChartTable.EndTime + 2 >= now) then + + if (bossInfo) then + local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo) + tinsert (mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()}) + mythicDungeonCharts:Debug ("Boss defeated, time saved, but used time aproximation:", mythicDungeonCharts.ChartTable.EndTime + 2, now, currentCombat:GetCombatTime()) + end + end + else + mythicDungeonCharts:Debug ("Boss defeated, but no chart capture is running") + end end + else + mythicDungeonCharts:Debug ("Boss defeated, but isn't a mythic dungeon boss fight") end end