Fix crash when doors.registered_doors isn't available

This commit is contained in:
Niklp 2024-10-17 11:14:04 +02:00
parent b46c589a38
commit 3c9055c723
No known key found for this signature in database
GPG Key ID: 05D6F5035E66267A

View File

@ -132,6 +132,7 @@ local function meseconify_trapdoor(name)
end
minetest.register_on_mods_loaded(function()
if doors.registered_doors ~= nil then -- registered_doors is not always available
for k,_ in pairs(doors.registered_doors) do
if k:find("_a$") then
meseconify_door(k:sub(1,-3))
@ -142,4 +143,5 @@ minetest.register_on_mods_loaded(function()
meseconify_trapdoor(k)
end
end
end
end)