Skip to content

Commit 9403ef1

Browse files
committed
Open Raid update
1 parent a20c87f commit 9403ef1

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Libs/LibOpenRaid/LibOpenRaid.lua

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ end
4444

4545
local major = "LibOpenRaid-1.0"
4646

47-
local CONST_LIB_VERSION = 137
47+
local CONST_LIB_VERSION = 138
4848

4949
if (LIB_OPEN_RAID_MAX_VERSION) then
5050
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then
@@ -585,10 +585,17 @@ end
585585
registeredUniqueTimers = {}
586586
}
587587

588+
local timersCanRunWithoutGroup = {
589+
["mainControl"] = {
590+
["updatePlayerData_Schedule"] = true
591+
}
592+
}
593+
588594
--run a scheduled function with its payload
589595
local triggerScheduledTick = function(tickerObject)
590596
local payload = tickerObject.payload
591597
local callback = tickerObject.callback
598+
local bCanRunWithoutGroup = tickerObject.bCanRunWithoutGroup
592599

593600
if (tickerObject.isUnique) then
594601
local namespace = tickerObject.namespace
@@ -598,7 +605,9 @@ end
598605

599606
--check if the player is still in group
600607
if (not openRaidLib.IsInGroup()) then
601-
return
608+
if (not bCanRunWithoutGroup) then
609+
return
610+
end
602611
end
603612

604613
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
@@ -610,9 +619,10 @@ end
610619
end
611620

612621
--create a new schedule
613-
function openRaidLib.Schedules.NewTimer(time, callback, ...)
622+
function openRaidLib.Schedules.NewTimer(time, callback, bCanRunWithoutGroup, ...)
614623
local payload = {...}
615624
local newTimer = C_Timer.NewTimer(time, triggerScheduledTick)
625+
newTimer.bCanRunWithoutGroup = bCanRunWithoutGroup
616626
newTimer.payload = payload
617627
newTimer.callback = callback
618628
--newTimer.stack = debugstack()
@@ -632,7 +642,9 @@ end
632642
openRaidLib.Schedules.CancelUniqueTimer(namespace, scheduleName)
633643
end
634644

635-
local newTimer = openRaidLib.Schedules.NewTimer(time, callback, ...)
645+
local bCanRunWithoutGroup = timersCanRunWithoutGroup[namespace] and timersCanRunWithoutGroup[namespace][scheduleName]
646+
647+
local newTimer = openRaidLib.Schedules.NewTimer(time, callback, bCanRunWithoutGroup, ...)
636648
newTimer.namespace = namespace
637649
newTimer.scheduleName = scheduleName
638650
--newTimer.stack = debugstack()

0 commit comments

Comments
 (0)