local format = string.format;
local InCombatLockdown = InCombatLockdown;
local CTimerAfter = C_Timer.After;
+local UnitIsDeadOrGhost = UnitIsDeadOrGhost;
local IsInGroup, IsInRaid = IsInGroup, IsInRaid;
local CheckInteractDistance = CheckInteractDistance;
local GetTime, UnitGUID, UnitName = GetTime, UnitGUID, UnitName;
-- not necessary, but there's too many issues with inspect,
-- try to hope being nearby makes it more likely to work
-- no need to inspect people not in range before pull anyway
- if CheckInteractDistance(id, 1) and CanInspect(id) then
+ if not UnitIsDeadOrGhost("player") and
+ CheckInteractDistance(id, 1) and CanInspect(id) then
if not inspecting then
inspecting = guid;
print("Sending inspect", UnitName(id));
if not inspectui then ClearInspectPlayer() end
else
if CanInspect(id) then
- if time - cached.time > 60 then -- refresh >1min
- -- new inspect
- cached.time = time;
- if cached.needItems then
- cached.weapon = GetInventoryItemLink(id, INVSLOT_MAINHAND);
- cached.wrist = GetInventoryItemID(id, INVSLOT_WRIST);
- end
- cached.spec = GetInspectSpecialization(id);
- local _, _, _, selected = GetTalentInfo(6, 2, 1, true, id);
- cached.talent = selected;
+ -- new inspect
+ cached.time = time;
+ if cached.needItems then
+ cached.weapon = GetInventoryItemLink(id, INVSLOT_MAINHAND);
+ cached.wrist = GetInventoryItemID(id, INVSLOT_WRIST);
end
+ cached.spec = GetInspectSpecialization(id);
+ local _, _, _, selected = GetTalentInfo(6, 2, 1, true, id);
+ cached.talent = selected;
end
if not inspectui then ClearInspectPlayer() end
if (cached.needItems and cached.weapon) or