mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Reduce minetest.after
time complexity and provide ordering guarantee
--------- Co-authored-by: Lars Mueller <appgurulars@gmx.de>
This commit is contained in:
committed by
Lars Müller
parent
ceaa7e2fb0
commit
e7dd9737bd
@@ -5288,6 +5288,9 @@ Utilities
|
||||
-- PseudoRandom has get_state method
|
||||
-- PcgRandom has get_state and set_state methods (5.9.0)
|
||||
random_state_restore = true,
|
||||
-- minetest.after guarantees that coexisting jobs are executed primarily
|
||||
-- in order of expiry and secondarily in order of registration (5.9.0)
|
||||
after_order_expiry_registration = true,
|
||||
}
|
||||
```
|
||||
|
||||
@@ -6458,6 +6461,8 @@ Timing
|
||||
* `minetest.after(time, func, ...)`: returns job table to use as below.
|
||||
* Call the function `func` after `time` seconds, may be fractional
|
||||
* Optional: Variable number of arguments that are passed to `func`
|
||||
* Jobs set for earlier times are executed earlier. If multiple jobs expire
|
||||
at exactly the same time, then they are executed in registration order.
|
||||
|
||||
* `job:cancel()`
|
||||
* Cancels the job function from being called
|
||||
|
Reference in New Issue
Block a user