From be64b37d9046b22e74e98ea44f20e70c819cb93c Mon Sep 17 00:00:00 2001 From: Ghost Date: Mon, 15 Jan 2024 15:13:28 -0600 Subject: [PATCH] Fix unit frame 'open profile' button (#822) * Add better unit token check * UnitExists is fine don't group with people named `anyfriend` and we're good --- totalRP3/Modules/Register/Main/RegisterExchange.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/totalRP3/Modules/Register/Main/RegisterExchange.lua b/totalRP3/Modules/Register/Main/RegisterExchange.lua index 11e12f23c..fcd2a8404 100644 --- a/totalRP3/Modules/Register/Main/RegisterExchange.lua +++ b/totalRP3/Modules/Register/Main/RegisterExchange.lua @@ -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 = {...}; @@ -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