From 4106c1e7fb8c80f08be7419a5639c486f413e433 Mon Sep 17 00:00:00 2001 From: Horyoshi <42314202+Cinecom@users.noreply.github.com> Date: Sat, 28 Mar 2026 14:23:28 +0100 Subject: [PATCH] Bug fix --- bench.lua | 7 ++++++- shootyepgp.lua | 28 ++++++++++++++++++++-------- shootyepgp.toc | 2 +- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bench.lua b/bench.lua index d1ec65c..629c5a8 100644 --- a/bench.lua +++ b/bench.lua @@ -186,7 +186,7 @@ function BenchTracker:CreateMainFrame() -- Scroll frame for AFK list local scrollFrame = CreateFrame("ScrollFrame", "BenchAfkScrollFrame", afkContent, "UIPanelScrollFrameTemplate") scrollFrame:SetPoint("TOPLEFT", afkContent, "TOPLEFT", 2, -14) - scrollFrame:SetPoint("BOTTOMRIGHT", afkContent, "BOTTOMRIGHT", -2, 26) + scrollFrame:SetPoint("BOTTOMRIGHT", afkContent, "BOTTOMRIGHT", -2, 50) local scrollChild = CreateFrame("Frame", "BenchAfkScrollChild", scrollFrame) scrollChild:SetWidth(245) @@ -282,6 +282,7 @@ function BenchTracker:CreateMainFrame() end end) benchRaidBtn:SetScript("OnClick", function() + if not BenchTracker:IsOfficer() then return end if benchSessionActive then BenchTracker:EndBenchSession() benchRaidBtnText:SetText("Bench this Raid") @@ -733,6 +734,10 @@ function BenchTracker:SendBenchRoster() end function BenchTracker:StartBenchSession() + if not BenchTracker:IsOfficer() then + DEFAULT_CHAT_FRAME:AddMessage("|cFFFF0000BenchTracker: Only officers can start bench sessions.|r") + return + end if GetNumRaidMembers() == 0 then DEFAULT_CHAT_FRAME:AddMessage("|cFFFF0000BenchTracker: You must be in a raid to start a bench session.|r") return diff --git a/shootyepgp.lua b/shootyepgp.lua index ba99632..3c8f921 100644 --- a/shootyepgp.lua +++ b/shootyepgp.lua @@ -1141,6 +1141,10 @@ function sepgp:addonComms(prefix,message,channel,sender) elseif admin() and what == "EP" and who and amount and amount < 0 then -- Log EP penalties for OTHER players msg = string.format(L["%s EP Penalty to %s%s."],amount,who,"") + elseif admin() and what == "EP" and who and amount and amount > 0 then + -- Log positive EP awards for OTHER players (so DLL can track adjustments) + local old_ep = (new_ep or 0) - amount + msg = string.format("Awarded %d EP to %s. (Previous: %d, New: %d)",amount,who,old_ep,math.max(0,new_ep or 0)) elseif who == "ALL" and what == "DECAY" then msg = string.format(L["%s%% decay to EP and GP."],amount) elseif who == "RAID" and what == "AWARD" then @@ -1495,9 +1499,9 @@ function sepgp:award_raid_ep(ep) -- awards ep to raid members in zone return end for i = 1, GetNumRaidMembers(true) do - local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(i) - if level >= sepgp.VARS.minlevel then - self:givename_ep(name,ep) + local name = GetRaidRosterInfo(i) + if name then + self:givename_ep(name,ep,true) end end self:simpleSay(string.format(L["Giving %d ep to all raidmembers"],ep)) @@ -1518,7 +1522,7 @@ function sepgp:award_reserve_ep(ep) -- awards ep to reserve list end for i, reserve in ipairs(sepgp.reserves) do local name, class, rank, alt = unpack(reserve) - self:givename_ep(name,ep) + self:givename_ep(name,ep,true) end self:simpleSay(string.format(L["Giving %d ep to active reserves"],ep)) self:addToLog(string.format(L["Giving %d ep to active reserves"],ep)) @@ -1530,7 +1534,7 @@ function sepgp:award_reserve_ep(ep) -- awards ep to reserve list end end -function sepgp:givename_ep(getname,ep) -- awards ep to a single character +function sepgp:givename_ep(getname,ep,silent) -- awards ep to a single character if not (admin()) then return end local postfix, alt = "" if (sepgp_altspool) then @@ -1542,14 +1546,22 @@ function sepgp:givename_ep(getname,ep) -- awards ep to a single character postfix = string.format(L[", %s\'s Main."],alt) end end - local newep = ep + (self:get_ep_v3(getname) or 0) - self:update_ep_v3(getname,newep) + local newep = ep + (self:get_ep_v3(getname) or 0) + self:update_ep_v3(getname,newep) self:debugPrint(string.format(L["Giving %d ep to %s%s."],ep,getname,postfix)) + if silent then return end -- raid-wide awards handle their own logging + local currentgp = self:get_gp_v3(getname) or sepgp.VARS.basegp if ep < 0 then -- inform admins and victim of penalties local msg = string.format(L["%s EP Penalty to %s%s."],ep,getname,postfix) self:adminSay(msg) self:addToLog(msg) - local currentgp = self:get_gp_v3(getname) or sepgp.VARS.basegp + local addonMsg = string.format("%s;%s;%s;%s;%s",getname,"EP",ep,math.max(0,newep),currentgp) + self:addonMessage(addonMsg,"GUILD") + else -- positive individual EP adjustments + local oldep = newep - ep + local msg = string.format("Awarded %d EP to %s%s. (Previous: %d, New: %d)",ep,getname,postfix,oldep,newep) + self:adminSay(msg) + self:addToLog(msg) local addonMsg = string.format("%s;%s;%s;%s;%s",getname,"EP",ep,math.max(0,newep),currentgp) self:addonMessage(addonMsg,"GUILD") end diff --git a/shootyepgp.toc b/shootyepgp.toc index 44d9f3f..5528838 100644 --- a/shootyepgp.toc +++ b/shootyepgp.toc @@ -7,7 +7,7 @@ ## X-Website: https://github.com/cinecom/shootyepgp/ ## X-Category: Guild ## X-Credits: shooty, Qcat(zhCN) -## Version: 10.19.7 +## Version: 10.19.8 ## X-Alpha: ## OptionalDeps: Ace2 ## SavedVariables: sepgp_saychannel, sepgp_groupbyclass, sepgp_groupbyarmor, sepgp_groupbyrole, sepgp_raidonly, sepgp_dbver, sepgp_debug, sepgp_fubar, sepgp_sound, RaidStrikeDB, RaidStrikeResetTime, BenchTrackerDB