mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement minetest.ipc_cas()
This commit is contained in:
parent
f1a436619f
commit
72801d0233
5 changed files with 68 additions and 8 deletions
|
@ -22,8 +22,11 @@ local function do_tests()
|
|||
assert(core.registered_items["unittests:description_test"].on_place == true)
|
||||
end
|
||||
|
||||
-- this is checked from the main env
|
||||
core.ipc_set("unittests:mg", { pcall(do_tests) })
|
||||
-- first thread to get here runs the tests
|
||||
if core.ipc_cas("unittests:mg_once", nil, true) then
|
||||
-- this is checked from the main env
|
||||
core.ipc_set("unittests:mg", { pcall(do_tests) })
|
||||
end
|
||||
|
||||
core.register_on_generated(function(vm, pos1, pos2, blockseed)
|
||||
local n = tonumber(core.get_mapgen_setting("chunksize")) * 16 - 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue