Details! Damage Meter

Details! Damage Meter

251M Downloads

Details.UnitInfo not returning info for players not on my realm

masterkain opened this issue ยท 0 comments

commented

I'm trying to debug this simple code:

        local unitInfo = Details.UnitInfo("target")

my issue is that it does not return values for players that are not on my realm and I'm unsure how to fix that.

while debugging a little i found this:

	local playerInfo = {}

	local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")
	if openRaidLib then
		playerInfo = openRaidLib.GetUnitInfo(unitName)
	end

	unitInfo.class = playerObject.classe or class or "UNKNOW"
	unitInfo.spec = playerObject.spec or specCache[unitSerial] or playerInfo.spec or 0

it's not much relevant but in the last line playerInfo can be empty so .spec will fail

Stack trace:
Details/functions/api2.lua:519: attempt to index local 'playerInfo' (a nil value)
[string "@Details/functions/api2.lua"]:519: in function `UnitInfo'

I just wanted to report that while I continue debugging

I did notice however that now in the details interface, if I disable"remove player realms" I see names in this format:

Nickname-Outland-EU while perhaps before was Nickname-Outland, not sure however as I usually run without realm names

basically for players not on my realm code will stop here:

	local playerObject = getActorObjectFromCombat (combatObject, 1, unitName)
	if (not playerObject) then
		return unitInfo
	end

returning the default object