Remove UnitIsUnit('player',X) checks, and change UnitName calls to use Details.playername

This commit is contained in:
Flamanis
2023-11-09 00:45:20 -06:00
parent bc0070cc6d
commit ce35713b50
10 changed files with 20 additions and 16 deletions
+1 -1
View File
@@ -601,7 +601,7 @@ hooksecurefunc (_G, "DeathRecap_LoadUI", function()
hooksecurefunc (_G, "DeathRecapFrame_OpenRecap", function(RecapID)
local currentCombat = Details:GetCurrentCombat()
--get the player current death and link the death table with the death recapID
local playerDeaths = currentCombat:GetPlayerDeaths(UnitName("player"))
local playerDeaths = currentCombat:GetPlayerDeaths(Details.playername)
if (playerDeaths) then
local latestDeath = playerDeaths[#playerDeaths]
if (latestDeath) then
+2 -2
View File
@@ -151,13 +151,13 @@ local tickerCallback = function(tickerObject)
--tick damage
local totalPlayers = GetNumGroupMembers()
for i = 1, totalPlayers-1 do
local unitName, unitRealm = UnitName ("party" .. i)
local unitName, unitRealm = UnitFullName ("party" .. i)
if (unitName) then
addPlayerDamage(unitName, unitRealm)
end
end
addPlayerDamage(UnitName("player"))
addPlayerDamage(UnitFullName("player"))
end
function mythicDungeonCharts:OnBossDefeated()
+2 -2
View File
@@ -427,7 +427,7 @@ function Details.packFunctions.PackDamage(combatObject)
local actorsToPack = {}
--get the player object from the combat > damage container
local playerName = UnitName("player")
local playerName = Details.playername
local playerObject = combatObject:GetActor(DETAILS_ATTRIBUTE_DAMAGE, playerName)
if (not playerObject) then
if (isDebugging) then
@@ -677,7 +677,7 @@ function Details.packFunctions.PackHeal(combatObject)
local actorsToPack = {}
--get the player object from the combat > damage container
local playerName = UnitName("player")
local playerName = Details.playername
local playerObject = combatObject:GetActor(DETAILS_ATTRIBUTE_HEAL, playerName)
if (not playerObject) then
if (isDebugging) then
+2 -2
View File
@@ -21,7 +21,7 @@ function augmentationFunctions.BuffIn(token, time, sourceSerial, sourceName, sou
end
elseif (spellId == 413984) then --ss
if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then
if (UnitExists(targetName) and targetName ~= Details.playername) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName(targetName, spellId, sourceName)
local versaGained = v1
if (type(versaGained) == "number") then
@@ -92,7 +92,7 @@ function augmentationFunctions.BuffRefresh(token, time, sourceSerial, sourceName
end
elseif (spellId == 413984) then --ss
if (UnitExists(targetName) and not UnitIsUnit("player", targetName)) then
if (UnitExists(targetName) and targetName ~= Details.playername) then
local auraName, texture, count, auraType, duration, expirationTime, sourceUnit, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossAura, isFromPlayerOrPlayerPet, nameplateShowAll, timeMod, v1, v2, v3, v4, v5 = Details:FindBuffCastedByUnitName (targetName, spellId, sourceName)
local versaGained = v1
+1 -1
View File
@@ -590,7 +590,7 @@ function Details222.TimeCapture.StartCombatTimer(combatObject)
Details222.TimeCapture.CombatTimeTicker = C_Timer.NewTicker(1, combatTimeTicker)
--debug: starting only for the player
Details222.TimeCapture.Start(UnitName("player"), DETAILS_ATTRIBUTE_DAMAGE)
Details222.TimeCapture.Start(Details.playername, DETAILS_ATTRIBUTE_DAMAGE)
end
--combat ended on Details! end