Fix critical double EP award bug
The _lastRaidAwardReceived timer was only set when receiving addon messages from OTHER officers. The awarding officer's own client never set this timer (addonComms rejects self-messages at line 1111), meaning the same officer could click Award EP twice with zero protection. This caused the entire guild to receive +175 phantom EP during Karazhan on April 2. Fix: set the timer IMMEDIATELY in award_raid_ep and award_reserve_ep, before the award loop runs. Now any call within 120 seconds of the previous one is blocked, regardless of who triggered it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3ce426f6fb
commit
27848e03ae
+4
-2
@@ -1495,10 +1495,11 @@ function sepgp:award_raid_ep(ep) -- awards ep to raid members in zone
|
||||
if GetNumRaidMembers()>0 then
|
||||
-- Safety: prevent double-award if another officer already awarded EP to this raid recently
|
||||
if self._lastRaidAwardReceived and (GetTime() - self._lastRaidAwardReceived) < 120 then
|
||||
self:defaultPrint(string.format("|cffff0000Warning: Another officer already awarded EP to a raid in the last 2 minutes. Award blocked to prevent double EP.|r"))
|
||||
self:defaultPrint(string.format("|cffff0000Warning: EP was already awarded in the last 2 minutes. Award blocked to prevent double EP.|r"))
|
||||
self:defaultPrint(string.format("|cffff0000If this was intentional, wait 2 minutes or /reload first.|r"))
|
||||
return
|
||||
end
|
||||
self._lastRaidAwardReceived = GetTime() -- Block any re-award within 120 seconds (self + other officers)
|
||||
for i = 1, GetNumRaidMembers(true) do
|
||||
local name = GetRaidRosterInfo(i)
|
||||
if name then
|
||||
@@ -1517,10 +1518,11 @@ function sepgp:award_reserve_ep(ep) -- awards ep to reserve list
|
||||
if table.getn(sepgp.reserves) > 0 then
|
||||
-- Safety: prevent double-award if another officer already awarded EP to reserves recently
|
||||
if self._lastReserveAwardReceived and (GetTime() - self._lastReserveAwardReceived) < 120 then
|
||||
self:defaultPrint(string.format("|cffff0000Warning: Another officer already awarded EP to reserves in the last 2 minutes. Award blocked to prevent double EP.|r"))
|
||||
self:defaultPrint(string.format("|cffff0000Warning: EP was already awarded to reserves in the last 2 minutes. Award blocked to prevent double EP.|r"))
|
||||
self:defaultPrint(string.format("|cffff0000If this was intentional, wait 2 minutes or /reload first.|r"))
|
||||
return
|
||||
end
|
||||
self._lastReserveAwardReceived = GetTime() -- Block any re-award within 120 seconds (self + other officers)
|
||||
for i, reserve in ipairs(sepgp.reserves) do
|
||||
local name, class, rank, alt = unpack(reserve)
|
||||
self:givename_ep(name,ep,true)
|
||||
|
||||
Reference in New Issue
Block a user