From e3fea28bda16135fac42bb09da619fbae6d17294 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Tue, 20 Jan 2015 21:30:14 +0100 Subject: [PATCH] Reverted the check for CanInspect before trying to inspect. --- src/inspect.lua | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/inspect.lua b/src/inspect.lua index 2b6f73c..7d49dab 100644 --- a/src/inspect.lua +++ b/src/inspect.lua @@ -229,26 +229,14 @@ function inspect:OnNotifyInspectTimerDone() -- Timeout any current inspection if self.currentInspectPlayerId then self:ResolveInspect(self.currentInspectPlayerId, false); - end - self.currentInspectPlayerId = nil; - - -- Go trough the inspect queue from start to end, rejecting - -- any queued requests for players that can not be inspected, - -- until a player that can be inspected is found. - for playerId, inspectData in pairs(self.inspectQueue) do - if CanInspect(inspectData.player.name, false) then - -- Start an inspect request for the player - NotifyInspect(inspectData.player.name); - self.currentInspectPlayerId = playerId; - break; - else - -- Could not be inspected, reject the request - self:ResolveInspect(playerId, false); - end + self.currentInspectPlayerId = nil; end - -- If we have no new inspects pending, stop the timer - if not self.currentInspectPlayerId then + local playerId, inspectData = next(self.inspectQueue); + if playerId then + NotifyInspect(inspectData.player.name); + self.currentInspectPlayerId = playerId; + else self:StopNotifyInspectTimer(); end end -- 1.7.9.5