Skip to content

Commit

Permalink
Use unmodified unit names
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed May 24, 2024
1 parent 2c1c394 commit 5fc66e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions LootReserve.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Windows/ServerWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions Windows/ServerWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5fc66e6

Please sign in to comment.