From 71f98f4a39020b7590ebdfc464bf3392cbbc246a Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Thu, 19 Sep 2024 14:45:03 -0300 Subject: [PATCH] Latest release started to cache the value of combat_type into the combat object, this has been proven to be bad as the combat type can change later by the context (activity) the player is doing --- boot.lua | 14 ++++++++++++-- classes/class_combat.lua | 22 +++++++++++----------- core/parser.lua | 8 ++++---- functions/mythicdungeon/segments.lua | 3 +++ 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/boot.lua b/boot.lua index 098e5ba76..bc54ea49e 100644 --- a/boot.lua +++ b/boot.lua @@ -19,8 +19,8 @@ local addonName, Details222 = ... local version, build, date, tvs = GetBuildInfo() - Details.build_counter = 13066 - Details.alpha_build_counter = 13066 --if this is higher than the regular counter, use it instead + Details.build_counter = 13070 + Details.alpha_build_counter = 13070 --if this is higher than the regular counter, use it instead Details.dont_open_news = true Details.game_version = version Details.userversion = version .. " " .. Details.build_counter @@ -341,6 +341,8 @@ return end + do return end + --if a context is found, finishes it before a new one is created if (self.bHasContext) then --discard the context @@ -377,6 +379,14 @@ --will ba called when the context finishes, in this case when the SCENARIO_COMPLETED event is triggered local fOnContextFinished = function() + --check if this is not a mythic+ run + if (C_ChallengeMode.GetActiveChallengeMapID() or C_ChallengeMode.GetActiveKeystoneInfo() or C_ChallengeMode.IsChallengeModeActive()) then + print("did not start as this is a m+ run") + return + else + print("this is not a m+ run") + end + ---@type combat[] local interestCombats = {} --get all segments diff --git a/classes/class_combat.lua b/classes/class_combat.lua index ef88671c8..2e05bd5fe 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -709,21 +709,21 @@ local segmentTypeToString = { end if (self.training_dummy) then - self.combat_type = DETAILS_SEGMENTTYPE_TRAININGDUMMY + --self.combat_type = DETAILS_SEGMENTTYPE_TRAININGDUMMY return DETAILS_SEGMENTTYPE_TRAININGDUMMY end --arena local arenaInfo = self.is_arena if (arenaInfo) then - self.combat_type = DETAILS_SEGMENTTYPE_PVP_ARENA + --self.combat_type = DETAILS_SEGMENTTYPE_PVP_ARENA return DETAILS_SEGMENTTYPE_PVP_ARENA end --battleground local battlegroundInfo = self.is_pvp if (battlegroundInfo) then - self.combat_type = DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND + --self.combat_type = DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND return DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND end @@ -732,42 +732,42 @@ local segmentTypeToString = { if (instanceType == "party") then if (self.is_dungeon_overall) then - self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_OVERALL + --self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_OVERALL return DETAILS_SEGMENTTYPE_DUNGEON_OVERALL end local bossInfo = self:GetBossInfo() if (bossInfo) then if (bossInfo.mapid == 33 and bossInfo.diff_string == "Event" and bossInfo.id == 2879) then --Shadowfang Keep | The Crown Chemical Co. - self.combat_type = DETAILS_SEGMENTTYPE_EVENT_VALENTINEDAY + --self.combat_type = DETAILS_SEGMENTTYPE_EVENT_VALENTINEDAY return DETAILS_SEGMENTTYPE_EVENT_VALENTINEDAY else - self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_BOSS + --self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_BOSS return DETAILS_SEGMENTTYPE_DUNGEON_BOSS end else - self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_TRASH + --self.combat_type = DETAILS_SEGMENTTYPE_DUNGEON_TRASH return DETAILS_SEGMENTTYPE_DUNGEON_TRASH end elseif (instanceType == "raid") then local bossEncounter = self.is_boss if (bossEncounter) then - self.combat_type = DETAILS_SEGMENTTYPE_RAID_BOSS + --self.combat_type = DETAILS_SEGMENTTYPE_RAID_BOSS return DETAILS_SEGMENTTYPE_RAID_BOSS else - self.combat_type = DETAILS_SEGMENTTYPE_RAID_TRASH + --self.combat_type = DETAILS_SEGMENTTYPE_RAID_TRASH return DETAILS_SEGMENTTYPE_RAID_TRASH end end --overall data if (self == Details.tabela_overall) then - self.combat_type = DETAILS_SEGMENTTYPE_OVERALL + --self.combat_type = DETAILS_SEGMENTTYPE_OVERALL return DETAILS_SEGMENTTYPE_OVERALL end - self.combat_type = DETAILS_SEGMENTTYPE_GENERIC + --self.combat_type = DETAILS_SEGMENTTYPE_GENERIC return DETAILS_SEGMENTTYPE_GENERIC end diff --git a/core/parser.lua b/core/parser.lua index 0d8bf23a5..f16d401fa 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -5343,7 +5343,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details.zone_id = zoneMapID Details.zone_name = zoneName - Details222.ContextManager:CheckContextInterest(zoneMapID, zoneName, zoneType, difficultyID) + --Details222.ContextManager:CheckContextInterest(zoneMapID, zoneName, zoneType, difficultyID) _in_resting_zone = IsResting() @@ -6017,9 +6017,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 if (Details.mythic_plus.show_damage_graphic) then C_Timer.After(0, function() - if (ChallengeModeCompleteBanner) then - ChallengeModeCompleteBanner.timeToHold = 0.01 - end + --if (ChallengeModeCompleteBanner) then + -- ChallengeModeCompleteBanner.timeToHold = 0.01 + --end end) end diff --git a/functions/mythicdungeon/segments.lua b/functions/mythicdungeon/segments.lua index b4616d105..7d9f741c6 100644 --- a/functions/mythicdungeon/segments.lua +++ b/functions/mythicdungeon/segments.lua @@ -68,8 +68,11 @@ function Details222.MythicPlus.OnBossDefeated(encounterID, encounterName) local combatType = pastCombat:GetCombatType() if (combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH or combatType == DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSSWIPE) then table.insert(segmentsToMerge, pastCombat) + else end + else end + else end end