# HG changeset patch # User James D. Callahan III # Date 1364832855 18000 # Node ID 495108578530da0b4998644dbd8c883f2f7844d6 # Parent 5ccdd6498c166c5e9f436a33e71fd062d6ec6b3e Added an NPC ID mapping table for the rare oddities such as Garalon (two different IDs, one used exclusively for LFR). diff -r 5ccdd6498c16 -r 495108578530 Main.lua --- a/Main.lua Mon Apr 01 10:30:14 2013 -0500 +++ b/Main.lua Mon Apr 01 11:14:15 2013 -0500 @@ -392,6 +392,11 @@ local UNIT_TYPES = private.UNIT_TYPES local UNIT_TYPE_BITMASK = 0x007 + local NPC_ID_MAPPING = { + [62164] = 63191, -- Garalon + } + + function ParseGUID(guid) if not guid then return @@ -404,7 +409,13 @@ local unit_type = _G.bit.band(bitfield, UNIT_TYPE_BITMASK) if unit_type ~= UNIT_TYPES.PLAYER and unit_type ~= UNIT_TYPES.PET then - return unit_type, tonumber(guid:sub(6, 10), 16) + local unit_idnum = tonumber(guid:sub(6, 10), 16) + local id_mapping = NPC_ID_MAPPING[unit_idnum] + + if id_mapping and UnitTypeIsNPC(unit_type) then + unit_idnum = id_mapping + end + return unit_type, unit_idnum end return unit_type end