fix difficulty ids

This commit is contained in:
andrew6180
2024-07-10 16:56:39 -07:00
parent bcee5fc71a
commit 27c64fd7fb
6 changed files with 18 additions and 19 deletions
+4 -4
View File
@@ -178,10 +178,10 @@ local segmentTypeToString = {
end end
local diffNumberToName = { local diffNumberToName = {
[1] = "normal", [0] = "normal",
[2] = "heroic", [1] = "heroic",
[3] = "mythic", [2] = "mythic",
[4] = "ascended", [3] = "ascended",
} }
function classCombat:GetDifficulty() function classCombat:GetDifficulty()
+1 -1
View File
@@ -4919,7 +4919,7 @@ function damageClass:MontaInfoDamageDone() --I guess this fills the list of spel
--guild ranking on a boss --guild ranking on a boss
--check if is a raid encounter and if is heroic or mythic --check if is a raid encounter and if is heroic or mythic
do 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() local db = Details.OpenStorage()
if (db) then if (db) then
---@type details_storage_unitresult, details_encounterkillinfo ---@type details_storage_unitresult, details_encounterkillinfo
+1 -2
View File
@@ -526,7 +526,6 @@
--flag instance type --flag instance type
local zoneName, instanceType, difficultyID, difficultyName, _, _, _, zoneMapID = GetInstanceInfo() local zoneName, instanceType, difficultyID, difficultyName, _, _, _, zoneMapID = GetInstanceInfo()
currentCombat.instance_type = instanceType currentCombat.instance_type = instanceType
if (not currentCombat.is_boss and bIsFromEncounterEnd and type(bIsFromEncounterEnd) == "table") then if (not currentCombat.is_boss and bIsFromEncounterEnd and type(bIsFromEncounterEnd) == "table") then
local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack(bIsFromEncounterEnd) local encounterID, encounterName, difficultyID, raidSize, endStatus = unpack(bIsFromEncounterEnd)
if (encounterID) then if (encounterID) then
@@ -730,7 +729,7 @@
if (IsInRaid()) then if (IsInRaid()) then
local cleuID = currentCombat.is_boss.id local cleuID = currentCombat.is_boss.id
local diff = currentCombat.is_boss.diff 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 local raidData = Details.raid_data
--get or build mythic raid data table --get or build mythic raid data table
+5 -5
View File
@@ -872,10 +872,10 @@ end)
local CONST_ADDONNAME_DATASTORAGE = "Details_DataStorage" local CONST_ADDONNAME_DATASTORAGE = "Details_DataStorage"
local diffNumberToName = { local diffNumberToName = {
[1] = "normal", [0] = "normal",
[2] = "heroic", [1] = "heroic",
[3] = "mythic", [2] = "mythic",
[4] = "ascended", [3] = "ascended",
} }
local createStorageTables = function() 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 ---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() function Details.ScheduleLoadStorage()
--check first if the storage is already loaded --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 Details.schedule_storage_load = nil
Details222.storageLoaded = true Details222.storageLoaded = true
return return
+5 -5
View File
@@ -395,16 +395,16 @@
--self is a timer reference from C_Timer --self is a timer reference from C_Timer
local diffNumberToName = { local diffNumberToName = {
[1] = "normal", [0] = "normal",
[2] = "heroic", [1] = "heroic",
[3] = "mythic", [2] = "mythic",
[4] = "ascended", [3] = "ascended",
} }
local encounterID = self.Boss local encounterID = self.Boss
local diff = self.Diff 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 local value, rank, combatTime = 0, 0, 0
if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then if (encounterID == lastRecordFound.id and diff == lastRecordFound.diff) then
+2 -2
View File
@@ -2163,8 +2163,8 @@ local iconFrame_OnEnter = function(self)
local diff, diffEngName = combat:GetDifficulty() local diff, diffEngName = combat:GetDifficulty()
local attribute, subattribute = instance:GetDisplay() local attribute, subattribute = instance:GetDisplay()
--check if is a raid encounter and if is heroic or mythic --check if is a raid encounter and if is mythic or ascended
if (diff and (diff == 15 or diff == 16) and (attribute == 1 or attribute == 2)) then --might give errors if (diff and (diff == 2 or diff == 3) and (attribute == 1 or attribute == 2)) then --might give errors
local db = Details.OpenStorage() local db = Details.OpenStorage()
if (db) then if (db) then
---@type details_storage_unitresult, details_encounterkillinfo ---@type details_storage_unitresult, details_encounterkillinfo