API 2.0 now uses Details:GetFullName(unitId) to retrieve a unit name

This commit is contained in:
Tercio Jose
2023-11-08 19:01:26 -03:00
parent dd13aff961
commit 3b2ba40b29
3 changed files with 10 additions and 13 deletions
+2 -2
View File
@@ -13,8 +13,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()
Details.build_counter = 12024
Details.alpha_build_counter = 12024 --if this is higher than the regular counter, use it instead
Details.build_counter = 12025
Details.alpha_build_counter = 12025 --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
+5 -11
View File
@@ -33,16 +33,8 @@ local getActorObjectFromCombat = function(combatObject, containerID, actorName)
end
local getUnitName = function(unitId)
local unitName, serverName = UnitName (unitId)
if (unitName) then
if (serverName and serverName ~= "") then
return unitName .. "-" .. serverName
else
return unitName
end
else
return unitId
end
local unitName = Details:GetFullName(unitId) or unitId
return unitName
end
--return the spell object and the spellId
@@ -652,12 +644,14 @@ function Details.UnitDamage (unitId, segment)
end
local unitName = getUnitName (unitId)
local playerObject = getActorObjectFromCombat (combatObject, 1, unitName)
if (not playerObject) then
return 0
end
--/dump Details.UnitDamage("player")
return floor(playerObject.total or 0)
end
+3
View File
@@ -175,6 +175,9 @@ do
end
function Details:GetFullName(unitId)
--playerName, realmName = UnitFullName(unitId) --realm name already has spaces removed
--return playerName .. "-" .. realmName
local playerName, realmName = UnitName(unitId)
if (not realmName) then