Quantcast

Change to anonymous function for callback.

Peter Eliasson [08-07-16 - 10:35]
Change to anonymous function for callback.
Filename
src/main.lua
diff --git a/src/main.lua b/src/main.lua
index ef76fdc..1880d15 100644
--- a/src/main.lua
+++ b/src/main.lua
@@ -199,8 +199,9 @@ function addon:OnEncounterEndSuccess(encounterId, encounterName, difficultyId, r
 		raidSize = raidSize
 	};

-
-	local function handleParses(success, startTime, duration, players)
+	-- Get parses from the parse provider
+	local pmc = self.parseModulesCore;
+	pmc:GetParsesForEncounter(encounter, function(success, startTime, duration, players)
 		if not success then
 			self:Debug("Skipping parse, success was false.");
 			return;
@@ -212,11 +213,7 @@ function addon:OnEncounterEndSuccess(encounterId, encounterName, difficultyId, r
 		addon.inspect:GetInspectDataForPlayers(players, function()
 			addon.highscore:AddEncounterParsesForPlayers(guildName, encounter, players);
 		end);
-	end
-
-	-- Get parses from the parse provider
-	local pmc = self.parseModulesCore;
-	pmc:GetParsesForEncounter(encounter, handleParses);
+	end);
 end

 function addon:PLAYER_GUILD_UPDATE(evt, unitId)