1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-10-31 23:30:31 +01:00

fix crash from default.chest.register_chest

This commit is contained in:
tour 2024-04-06 22:34:20 +02:00 committed by GitHub
parent 16c663f87e
commit 926cd2cbfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -297,9 +297,10 @@ function default.chest.register_chest(prefixed_name, d)
end end
-- close opened chests on load -- close opened chests on load
local modname, chestname = prefixed_name:match("^(:?.-):(.*)$")
minetest.register_lbm({ minetest.register_lbm({
label = "close opened chests on load", label = "close opened chests on load",
name = "default:close_" .. prefixed_name:gsub(":", "_") .. "_open", name = modname .. ":close_" .. chestname .. "_open",
nodenames = {prefixed_name .. "_open"}, nodenames = {prefixed_name .. "_open"},
run_at_every_load = true, run_at_every_load = true,
action = function(pos, node) action = function(pos, node)