From 27c64fd7fbc7b9cad162afc4adf942a9125816c0 Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:56:39 -0700 Subject: [PATCH] fix difficulty ids --- classes/class_combat.lua | 8 ++++---- classes/class_damage.lua | 2 +- core/control.lua | 3 +-- core/gears.lua | 10 +++++----- core/parser.lua | 10 +++++----- frames/window_main.lua | 4 ++-- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/classes/class_combat.lua b/classes/class_combat.lua index 12e47b86..bba3d63f 100644 --- a/classes/class_combat.lua +++ b/classes/class_combat.lua @@ -178,10 +178,10 @@ local segmentTypeToString = { end local diffNumberToName = { - [1] = "normal", - [2] = "heroic", - [3] = "mythic", - [4] = "ascended", + [0] = "normal", + [1] = "heroic", + [2] = "mythic", + [3] = "ascended", } function classCombat:GetDifficulty() diff --git a/classes/class_damage.lua b/classes/class_damage.lua index c4d0ba3a..e4b697a5 100644 --- a/classes/class_damage.lua +++ b/classes/class_damage.lua @@ -4919,7 +4919,7 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel --guild ranking on a boss --check if is a raid encounter and if is heroic or mythic do - if (diff and (diff == 1 or diff == 2 or diff == 3 or diff == 4)) then --this might give errors + if (diff and (diff == 0 or diff == 1 or diff == 2 or diff == 3)) then --this might give errors local db = Details.OpenStorage() if (db) then ---@type details_storage_unitresult, details_encounterkillinfo diff --git a/core/control.lua b/core/control.lua index ae2ad417..7c3af938 100644 --- a/core/control.lua +++ b/core/control.lua @@ -526,7 +526,6 @@ --flag instance type local zoneName, instanceType, difficultyID, difficultyName, _, _, _, zoneMapID = GetInstanceInfo() currentCombat.instance_type = instanceType - if (not currentCombat.is_boss and bIsFromEncounterEnd and type(bIsFromEncounterEnd) == "table") then local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack(bIsFromEncounterEnd) if (encounterID) then @@ -730,7 +729,7 @@ if (IsInRaid()) then local cleuID = currentCombat.is_boss.id local diff = currentCombat.is_boss.diff - if (cleuID and diff == 16) then -- 16 mythic + if (cleuID and diff == 3) then -- 3 ascended local raidData = Details.raid_data --get or build mythic raid data table diff --git a/core/gears.lua b/core/gears.lua index 40fac46b..0e890441 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -872,10 +872,10 @@ end) local CONST_ADDONNAME_DATASTORAGE = "Details_DataStorage" local diffNumberToName = { - [1] = "normal", - [2] = "heroic", - [3] = "mythic", - [4] = "ascended", + [0] = "normal", + [1] = "heroic", + [2] = "mythic", + [3] = "ascended", } local createStorageTables = function() @@ -1651,7 +1651,7 @@ end ---load the storage addon when the player leave combat, this function is also called from the parser when the player has its regen enabled function Details.ScheduleLoadStorage() --check first if the storage is already loaded - if (C_AddOns.IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then + if (IsAddOnLoaded(CONST_ADDONNAME_DATASTORAGE)) then Details.schedule_storage_load = nil Details222.storageLoaded = true return diff --git a/core/parser.lua b/core/parser.lua index 12c1dea8..5cf014ec 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -395,16 +395,16 @@ --self is a timer reference from C_Timer local diffNumberToName = { - [1] = "normal", - [2] = "heroic", - [3] = "mythic", - [4] = "ascended", + [0] = "normal", + [1] = "heroic", + [2] = "mythic", + [3] = "ascended", } local encounterID = self.Boss local diff = self.Diff - if (diff == 1 or diff == 2 or diff == 3 or diff == 4) then --might give errors + if (diff == 0 or diff == 1 or diff == 2 or diff == 3) then --might give errors local value, rank, combatTime = 0, 0, 0 if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then diff --git a/frames/window_main.lua b/frames/window_main.lua index f4fe27a5..1072bbde 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -2163,8 +2163,8 @@ local iconFrame_OnEnter = function(self) local diff, diffEngName = combat:GetDifficulty() local attribute, subattribute = instance:GetDisplay() - --check if is a raid encounter and if is heroic or mythic - if (diff and (diff == 15 or diff == 16) and (attribute == 1 or attribute == 2)) then --might give errors + --check if is a raid encounter and if is mythic or ascended + if (diff and (diff == 2 or diff == 3) and (attribute == 1 or attribute == 2)) then --might give errors local db = Details.OpenStorage() if (db) then ---@type details_storage_unitresult, details_encounterkillinfo