Skip to content

Commit bb0ffcf

Browse files
committed
add some protections to not run code in midnight
1 parent 987deee commit bb0ffcf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

EventHandler.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function MPT:ToggleEventRegister(On)
3030
end)
3131
end
3232
else
33+
if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
3334
f:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
3435
f:UnregisterEvent("UNIT_THREAT_LIST_UPDATE")
3536
f:UnregisterEvent("PLAYER_REGEN_ENABLED")
@@ -137,6 +138,7 @@ function MPT:EventHandler(e, ...) -- internal checks whether the event comes fro
137138
print("Debug mode for MPlusTimer is currently enabled. You can disable it with '/mpt debug'")
138139
end
139140
elseif e == "COMBAT_LOG_EVENT_UNFILTERED" and C_ChallengeMode.IsChallengeModeActive() then
141+
if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
140142
local _, se, _, _, _, _, _, destGUID = ...
141143
if se == "UNIT_DIED" and destGUID then
142144
local npcID = select(6, strsplit("-", destGUID))
@@ -147,6 +149,7 @@ function MPT:EventHandler(e, ...) -- internal checks whether the event comes fro
147149
end
148150
end
149151
elseif e == "UNIT_THREAT_LIST_UPDATE" and C_ChallengeMode.IsChallengeModeActive() and InCombatLockdown() then
152+
if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
150153
local unit = ...
151154
if unit and UnitExists(unit) then
152155
local guid = UnitGUID(unit)
@@ -163,6 +166,7 @@ function MPT:EventHandler(e, ...) -- internal checks whether the event comes fro
163166
end
164167
end
165168
elseif (e == "PLAYER_REGEN_ENABLED" or e == "PLAYER_DEAD") and C_ChallengeMode.IsChallengeModeActive() then
169+
if GetRestrictedActionStatus then return end -- disable for midnight. Edit this later when I know how the API works
166170
for k, _ in pairs(self.CurrentPull or {}) do
167171
self.CurrentPull[k] = nil
168172
end

0 commit comments

Comments
 (0)