From 1c394a261a5536a283cef626880599a086170ecc Mon Sep 17 00:00:00 2001 From: Tercio Date: Mon, 28 Mar 2016 19:28:22 -0300 Subject: [PATCH] - fix for the leech plugin. --- boot.lua | 2 +- plugins/Details_CalcLeech/Details_CalcLeech.lua | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/boot.lua b/boot.lua index d2f20ea8..311e6278 100644 --- a/boot.lua +++ b/boot.lua @@ -4,7 +4,7 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 2500 --it's 2500 for release - _detalhes.userversion = "v4.4" + _detalhes.userversion = "v4.4a" _detalhes.realversion = 81 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes diff --git a/plugins/Details_CalcLeech/Details_CalcLeech.lua b/plugins/Details_CalcLeech/Details_CalcLeech.lua index add85bca..965b4803 100644 --- a/plugins/Details_CalcLeech/Details_CalcLeech.lua +++ b/plugins/Details_CalcLeech/Details_CalcLeech.lua @@ -10,7 +10,7 @@ do local _ --> minimal details version required to run this plugin - local MINIMAL_DETAILS_VERSION_REQUIRED = 76 + local MINIMAL_DETAILS_VERSION_REQUIRED = 81 local CLEECH_VERSION = "v1.0" --> create a plugin object @@ -89,10 +89,10 @@ do if (total_leech > 0) then for from, leech_amount in pairs (rosterLeechAmount) do - if not combat.PlayerLeechTrinket [from] then - combat.PlayerLeechTrinket [from] = 0 + if (not calcLeech.combat.PlayerLeechTrinket [from]) then + calcLeech.combat.PlayerLeechTrinket [from] = 0 end - combat.PlayerLeechTrinket [from] = combat.PlayerLeechTrinket [from] + (healed * (leech_amount / total_leech)) + calcLeech.combat.PlayerLeechTrinket [from] = calcLeech.combat.PlayerLeechTrinket [from] + (healed * (leech_amount / total_leech)) end end end @@ -110,6 +110,8 @@ do --> when receiving an event from details, handle it here local player_has_trinket = function (combat) + calcLeech.combat = combat + --> check if exists a custom display to show the trinket leech local customObject = calcLeech:GetCustomObject (CUSTOM_DISPLAY_NAME) if (customObject) then @@ -121,7 +123,7 @@ do create_custom_object() end - combat.PlayerLeechTrinket = {} + calcLeech.combat.PlayerLeechTrinket = {} f:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") @@ -172,7 +174,7 @@ do end --> Install: install -> if successful installed; saveddata -> a table saved inside details db, used to save small amount of data like configs - local install, saveddata = Details:InstallPlugin ("TOOLBAR", "Leech Trinket", "Interface\\Icons\\Ability_Warrior_BattleShout", calcLeech, "DETAILS_PLUGIN_LEECH_TRINKET", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", CLEECH_VERSION) + local install, saveddata = Details:InstallPlugin ("TOOLBAR", "Leech Trinket", "Interface\\Icons\\spell_shadow_lifedrain02", calcLeech, "DETAILS_PLUGIN_LEECH_TRINKET", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", CLEECH_VERSION) if (type (install) == "table" and install.error) then print (install.error) end