Skip to content

Commit

Permalink
Fix unit frame 'open profile' button (#822)
Browse files Browse the repository at this point in the history
* Add better unit token check

* UnitExists is fine

don't group with people named `anyfriend` and we're good
  • Loading branch information
Ghostopheles authored Jan 15, 2024
1 parent d8c4998 commit be64b37
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions totalRP3/Modules/Register/Main/RegisterExchange.lua
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,6 @@ function TRP3_API.register.inits.dataExchangeInit()
end);
end

local UNIT_TOKENS = { "target", "mouseover", "player", "focus" };
UNIT_TOKENS = tInvert(UNIT_TOKENS);

function TRP3_API.slash.openProfile(...)
local args = {...};

Expand All @@ -618,7 +615,7 @@ function TRP3_API.slash.openProfile(...)
elseif #args == 1 then
characterToOpen = table.concat(args, " ");

if UNIT_TOKENS[characterToOpen:lower()] then
if UnitExists(characterToOpen:lower()) then
-- If we typed a unit token we resolve it
characterToOpen = Utils.str.getUnitID(characterToOpen:lower());
else
Expand Down

0 comments on commit be64b37

Please sign in to comment.