From 2927fa216cbd353d22f629fe174eaaebf4bfea54 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Fri, 23 Jan 2015 17:23:59 +0100 Subject: [PATCH] Fix not fully successful inspects being saved as valid inspect cache entries. --- src/inspect.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/inspect.lua b/src/inspect.lua index 7d49dab..1a1abf1 100644 --- a/src/inspect.lua +++ b/src/inspect.lua @@ -100,9 +100,14 @@ end local function setPlayerInspectCache(playerId, specName, itemLevel) inspectCache[playerId] = {}; - inspectCache[playerId].time = GetTime(); inspectCache[playerId].specName = specName; inspectCache[playerId].itemLevel = itemLevel; + if specName and itemLevel then + -- Dont set time if not all values are provided, as that would + -- make this entry valid and prevent inspections of the player + -- for the duration of the INSPECT_CACHE_TIMEOUT. + inspectCache[playerId].time = GetTime(); + end end function inspect:StartNotifyInspectTimer() -- 1.7.9.5