From c6ce67eb771affee3b7ce55531a68c2449291b01 Mon Sep 17 00:00:00 2001 From: Alar of Daggerspine Date: Mon, 20 Jul 2015 12:26:49 +0200 Subject: [PATCH] Working on memory allocation Signed-off-by: Alar of Daggerspine --- PartyCache.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PartyCache.lua b/PartyCache.lua index 059ff44..66eddf7 100644 --- a/PartyCache.lua +++ b/PartyCache.lua @@ -13,6 +13,7 @@ local type=type local pairs=pairs local format=format -- Temporary party management +local empty={} local parties=setmetatable({},{ __index=function(t,k) rawset(t,k, { @@ -24,7 +25,8 @@ local parties=setmetatable({},{ xpBonus=0, gold=0, goldMultiplier=1, - materialMultiplier=1, + partyBuffs=empty, + materialMultiplier=empty, resources=0, totalTimeString="Not Running", totalTimeSeconds=0 @@ -199,13 +201,20 @@ end function addon:GetParties() return self:GetParty() end + function addon:GetParty(missionID,key,default) if not missionID then return parties end local party=parties[missionID] + if not party then print(GetTime(),missionID,G.GetMissionName(missionID),"Empty") end + if not party then return default end if #party.members==0 and G.GetNumFollowersOnMission(missionID)>0 then + if not party.perc or party.perc < 1 then + party.perc=G.GetMissionSuccessChance(missionID) + end --Running Mission, taking followers from mission data local followers=self:GetMissionData(missionID,'followers') - addPartyMissionInfo(party,missionID) + print(followers) + --addPartyMissionInfo(party,missionID) if followers then for i=1,#followers do party.members[i]=followers[i] @@ -213,7 +222,7 @@ function addon:GetParty(missionID,key,default) end end if key then - return party[key] + return party[key] or default else return party end -- 1.7.9.5