From 5772cf2f91726e364c99d220899fca493fee4783 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Wed, 17 Jun 2026 20:19:42 -0500 Subject: [PATCH] GetUnitData -> GetUnitInfo avoid clash --- libs/libunitscan.lua | 4 ++-- modules/afkcam.lua | 2 +- modules/chat.lua | 2 +- modules/nameplates.lua | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/libunitscan.lua b/libs/libunitscan.lua index 326c111c..8504bc27 100644 --- a/libs/libunitscan.lua +++ b/libs/libunitscan.lua @@ -10,7 +10,7 @@ setfenv(1, pfUI:GetEnvironment()) -- on further expansions. -- -- External functions: --- GetUnitData(name, active) +-- GetUnitInfo(name, active) -- Returns information of the given unitname. Returns nil if no match is found. -- When nothing is found and the active flag is set, the autoscanner will -- automatically pick it up and try to fill the missing entry by targetting the unit. @@ -44,7 +44,7 @@ local function RememberByUnit(unit, name, class) C_PlayerCache.RememberPlayer(guid, name, class, UnitRace(unit), UnitSex(unit)) end -function GetUnitData(name, active) +function GetUnitInfo(name, active) if units["players"][name] then local ret = units["players"][name] return ret.class, ret.level, ret.elite, true, ret.guild diff --git a/modules/afkcam.lua b/modules/afkcam.lua index 63a9904d..df911f9c 100644 --- a/modules/afkcam.lua +++ b/modules/afkcam.lua @@ -61,7 +61,7 @@ pfUI:RegisterModule("afkcam", function () if not this:IsVisible() then return end local info = _G.ChatTypeInfo[string.gsub(event,"CHAT_MSG_","")] if not info then return end - local class = GetUnitData(arg2 or "") + local class = GetUnitInfo(arg2 or "") local author, msg if class and class ~= UNKNOWN then local class_color = PFUI_CLASS_COLORS[class]:GenerateHexColorMarkup() diff --git a/modules/chat.lua b/modules/chat.lua index eacac777..3987ef8f 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -763,7 +763,7 @@ pfUI:RegisterModule("chat", function () -- _, class = GetPlayerInfoByGUID(guid) -- end if not class then - class = GetUnitData(real) + class = GetUnitInfo(real) end if class then if class ~= UNKNOWN then diff --git a/modules/nameplates.lua b/modules/nameplates.lua index d9e2fe46..50d9bd5f 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -1023,7 +1023,7 @@ end local hpmin, hpmax = plate.original.healthbar:GetMinMaxValues() local name = plate.original.name:GetText() local level = plate.original.level:IsShown() and plate.original.level:GetObjectType() == "FontString" and tonumber(plate.original.level:GetText()) or "??" - local class, ulevel, elite, player, guild = GetUnitData(name, true) + local class, ulevel, elite, player, guild = GetUnitInfo(name, true) -- Use database level ONLY if current level is ?? (fixes ?? after reload, but doesn't override visible levels) local levelFromDB = false @@ -1545,7 +1545,7 @@ end end -- trigger update when unit was found - if nameplate.wait_for_scan and GetUnitData(name, true) then + if nameplate.wait_for_scan and GetUnitInfo(name, true) then nameplate.wait_for_scan = nil update = true end