Skip to content

Commit

Permalink
Latest release started to cache the value of combat_type into the com…
Browse files Browse the repository at this point in the history
…bat object, this has been proven to be bad as the combat type can change later by the context (activity) the player is doing
  • Loading branch information
Tercioo committed Sep 19, 2024
1 parent ffd75ca commit 71f98f4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
14 changes: 12 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions classes/class_combat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions functions/mythicdungeon/segments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 71f98f4

Please sign in to comment.