From 5fc66e66b045b79b7e30e6697d464edc4c69105f Mon Sep 17 00:00:00 2001 From: Anonomit Date: Thu, 23 May 2024 20:53:47 -0400 Subject: [PATCH] Use unmodified unit names --- LootReserve.lua | 6 +++--- Server.lua | 2 +- Windows/ServerWindow.lua | 2 +- Windows/ServerWindow.xml | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LootReserve.lua b/LootReserve.lua index 8709f7e..7c7a2e8 100644 --- a/LootReserve.lua +++ b/LootReserve.lua @@ -504,7 +504,7 @@ function LootReserve:Player(player) end function LootReserve:Me() - return self:Player(UnitName("player")); + return self:Player(UnitNameUnmodified("player")); end function LootReserve:IsMe(player) @@ -648,7 +648,7 @@ end local function GetRaidUnitID(player) for i = 1, MAX_RAID_MEMBERS do - local unit = UnitName("raid" .. i); + local unit = UnitNameUnmodified("raid" .. i); if unit and LootReserve:IsSamePlayer(LootReserve:Player(unit), player) then return "raid" .. i; end @@ -661,7 +661,7 @@ end local function GetPartyUnitID(player) for i = 1, MAX_PARTY_MEMBERS do - local unit = UnitName("party" .. i); + local unit = UnitNameUnmodified("party" .. i); if unit and LootReserve:IsSamePlayer(LootReserve:Player(unit), player) then return "party" .. i; end diff --git a/Server.lua b/Server.lua index 383bcfa..adcfc39 100644 --- a/Server.lua +++ b/Server.lua @@ -930,7 +930,7 @@ function LootReserve.Server:UpdateTradeFrameAutoButton(accepting) return; end - local target = LootReserve:Player(UnitName("npc")); + local target = LootReserve:Player(UnitNameUnmodified("npc")); local itemsToInsert = { }; local slotsFree = 6; local relevantSlots = 0; diff --git a/Windows/ServerWindow.lua b/Windows/ServerWindow.lua index 74cca21..49c8d7f 100644 --- a/Windows/ServerWindow.lua +++ b/Windows/ServerWindow.lua @@ -583,7 +583,7 @@ function LootReserve.Server:UpdateRollList(lockdown) frame.DistributeButton.Tradeable = tradeable; local unit = LootReserve:GetGroupUnitID(player); - if not unit and UnitExists("target") and UnitIsPlayer("target") and LootReserve:Player(UnitName("target")) == player then + if not unit and UnitExists("target") and UnitIsPlayer("target") and LootReserve:Player(UnitNameUnmodified("target")) == player then unit = "target"; end frame.DistributeButton.Unit = unit; diff --git a/Windows/ServerWindow.xml b/Windows/ServerWindow.xml index 5b026c9..722f418 100644 --- a/Windows/ServerWindow.xml +++ b/Windows/ServerWindow.xml @@ -674,7 +674,7 @@ end self.Locator.m1 = DBM.HudMap:RegisterRangeMarkerOnPartyMember(87654, "party", LootReserve:Me(), 0.5, nil, color1.r, color1.g, color1.b, 1, nil, false); - self.Locator.m2 = DBM.HudMap:RegisterRangeMarkerOnPartyMember(87654, "party", UnitName(unit), 0.75, nil, color2.r, color2.g, color2.b, 1, nil, false); + self.Locator.m2 = DBM.HudMap:RegisterRangeMarkerOnPartyMember(87654, "party", UnitNameUnmodified(unit), 0.75, nil, color2.r, color2.g, color2.b, 1, nil, false); self.Locator.edge = self.Locator.m2:EdgeTo(self.Locator.m1, nil, nil, 0, 1, 0, 1); -- Play appearing animation @@ -829,7 +829,7 @@ if not unit then return; end if self.Lootable then - LootReserve.Server:MasterLootItem(item, LootReserve:Player(UnitName(unit))); + LootReserve.Server:MasterLootItem(item, LootReserve:Player(UnitNameUnmodified(unit))); elseif self.Tradeable then local bag, slot = LootReserve:GetBagSlot(item, true); if bag and slot then @@ -979,7 +979,7 @@ func = function(info) local frame = self:GetParent():GetParent(); if not frame.Roll then return; end - local recipient = UnitIsPlayer("target") and UnitIsConnected("target") and UnitName("target"); + local recipient = UnitIsPlayer("target") and UnitIsConnected("target") and UnitNameUnmodified("target"); if info.arg1 == "WHISPER" and not recipient then LootReserve:PrintError("Target is not a valid player to whisper.") return; @@ -1089,7 +1089,7 @@ disabled = not condition, func = function(info) local frame = self:GetParent():GetParent(); - local recipient = UnitIsPlayer("target") and UnitIsConnected("target") and UnitName("target"); + local recipient = UnitIsPlayer("target") and UnitIsConnected("target") and UnitNameUnmodified("target"); if info.arg1 == "WHISPER" and not recipient then LootReserve:PrintError("Target is not a valid player to whisper.") return;