Skip to content

Commit 2502094

Browse files
committed
Merge remote-tracking branch 'origin/master-MC1.7.10' into master-MC1.12
2 parents 979c8df + 7fecb07 commit 2502094

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

changelog.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111

1212
## OpenOS fixes/improvements
1313

14+
* [#3714] Fix an OpenOS 1.8.0 regression causing event.pullFiltered() to effectively ignore filter timeouts.
1415
* [#3727] Fix an exception handler bug in process.lua, uncovered by fixing recursive xpcall() handling in 1.8.4.
1516

1617
## List of contributors
1718

18-
asie, charagarland, HfSr, Timothé GRISOT
19+
asie, charagarland, DragDen, HfSr, Timothé GRISOT

src/main/resources/assets/opencomputers/loot/openos/lib/event.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,13 @@ function event.pullFiltered(...)
140140
filter = args[2]
141141
end
142142

143+
local deadline = computer.uptime() + (seconds or math.huge)
143144
repeat
144-
local signal = table.pack(computer.pullSignal(seconds))
145+
local waitTime = deadline - computer.uptime()
146+
if waitTime <= 0 then
147+
break
148+
end
149+
local signal = table.pack(computer.pullSignal(waitTime))
145150
if signal.n > 0 then
146151
if not (seconds or filter) or filter == nil or filter(table.unpack(signal, 1, signal.n)) then
147152
return table.unpack(signal, 1, signal.n)

0 commit comments

Comments
 (0)