mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-12-25 02:00:39 +01:00
Fix undefined variable access in worldedit.metaload
`file` in the deprecated `worldedit.metaload` function was undefined, as reported by luacheck.
This commit is contained in:
parent
7f7e928dd9
commit
099d5047bd
@ -24,11 +24,14 @@ function worldedit.metasave(pos1, pos2, filename)
|
|||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
function worldedit.metaload(originpos, filename)
|
function worldedit.metaload(originpos, file_name)
|
||||||
deprecated("load")
|
deprecated("load")
|
||||||
filename = minetest.get_worldpath() .. "/schems/" .. file .. ".wem"
|
local file_path = minetest.get_worldpath() ..
|
||||||
local file, err = io.open(filename, "wb")
|
"/schems/" .. file_name .. ".wem"
|
||||||
if err then return 0 end
|
local file, err = io.open(file_path, "wb")
|
||||||
|
if err then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
local data = file:read("*a")
|
local data = file:read("*a")
|
||||||
return worldedit.deserialize(originpos, data)
|
return worldedit.deserialize(originpos, data)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user