mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2024-09-27 15:10:17 +02:00
Fix the undefined variable file warning
This commit is contained in:
parent
aa14bb012d
commit
14a602849e
|
@ -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