mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2025-06-28 14:36:07 +02:00
Various code fixes detected by luacheck
* Luablock: Fix the missing position argument when executing the lua code fails * Wireless: Fix the missing id argument * Localize several variables * Some other small changes, e.g. dead code removal
This commit is contained in:
committed by
Pierre-Adrien Langrognet
parent
28292dc2a5
commit
c41d0371c0
@ -76,14 +76,17 @@ end]]
|
||||
local file_path = minetest.get_worldpath().."/MoreMesecons_lctt"
|
||||
|
||||
-- load templates from a compressed file
|
||||
local templates_file = io.open(file_path, "rb")
|
||||
if templates_file then
|
||||
local templates_raw = templates_file:read("*all")
|
||||
io.close(templates_file)
|
||||
if templates_raw
|
||||
and templates_raw ~= "" then
|
||||
for name,t in pairs(minetest.deserialize(minetest.decompress(templates_raw))) do
|
||||
templates[name] = t
|
||||
do
|
||||
local templates_file = io.open(file_path, "rb")
|
||||
if templates_file then
|
||||
local templates_raw = templates_file:read("*all")
|
||||
io.close(templates_file)
|
||||
if templates_raw
|
||||
and templates_raw ~= "" then
|
||||
local data = minetest.deserialize(minetest.decompress(templates_raw))
|
||||
for name,t in pairs(data) do
|
||||
templates[name] = t
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user