Skip to content

Commit

Permalink
Fix distribute button text while trading outside an instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Jun 3, 2024
1 parent b71bcec commit 3e0f236
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Windows/ServerWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -732,14 +732,15 @@
end

local min, max, angle, distText = LootReserve:GetRange(unit, playerPos, targetPos);
local range = max or min;

if angle then
self.Arrow:Show();
self.Arrow:SetRotation(angle);
end

if LootReserve:IsRangeCheckRestricted(unit) and not angle then
if not (max or min) then
if not range then
return self:SetState(UnitIsVisible(unit) and "Approach" or "Travel", false, false);
end
if min <= 10 then
Expand All @@ -748,8 +749,8 @@
return self:SetState(format("%s: %s", UnitIsVisible(unit) and "Approach" or "Travel", distText), false, false);
end

if LootReserve:CanLocate() or not LootReserve:IsRangeCheckRestricted(unit) and not LootReserve:CheckInteractDistance(unit, 2) then
if not (max or min) then
if LootReserve:CanLocate() and (not range or range > 9) or not LootReserve:IsRangeCheckRestricted(unit) and not LootReserve:CheckInteractDistance(unit, 2) then
if not range then
return self:SetState(UnitIsVisible(unit) and "Approach" or "Travel", false, false);
end

Expand All @@ -761,11 +762,11 @@
return self:SetState(format("%s: %s", "Phased", distText), false, false);
end

if not UnitIsVisible(unit) and (max or min) <= 9 then
if not UnitIsVisible(unit) and range <= 9 then
return self:SetState(format("%s: %s", "Wrong Layer", distText), false, false);
end

if (max or min) <= 9 then
if range <= 9 then
if not LootReserve:CanLocate() then
return self:SetState(format("%s: %s", "Above/Below", distText), false, false);
else
Expand Down

0 comments on commit 3e0f236

Please sign in to comment.