From e260f73f37dd51ae8102dd8e0c06fbbc3a4e3dd0 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Wed, 3 Aug 2016 19:15:51 +0200 Subject: [PATCH] Only try get ilvl for players of our guild. As getting item level can be slow, we should only do it when we have to. --- src/inspect.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/inspect.lua b/src/inspect.lua index ef93ae3..0c3bac4 100644 --- a/src/inspect.lua +++ b/src/inspect.lua @@ -124,6 +124,10 @@ end -- inspection handling. In our case, we need to try and grab -- the item level here, as that is not provided by LGIST. function inspect:GroupInSpecT_InspectReady(evt, guid, unit) + -- As getting the itemLevel can be slow, we don't perform this + -- action for players that are not currently part of our guild. + if not addon:IsInMyGuild(unit) then return end + self.playerInfo[guid] = self.playerInfo[guid] or {}; local playerInfo = self.playerInfo[guid]; @@ -144,6 +148,10 @@ end -- LGIST event for when info for a player is ready or has been modified. function inspect:GroupInSpecT_Update(evt, guid, unit, info) + -- We do not bother checking guild here, as the expensive operation + -- (the inspection) has already been done. Better then to store the + -- data, if the player later joins our guild during the raid. + self.playerInfo[guid] = self.playerInfo[guid] or {}; local playerInfo = self.playerInfo[guid]; -- 1.7.9.5