From 14a602849e9601bb0512c02caa586b5a11a04931 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 17 Jan 2021 17:02:09 +0100 Subject: [PATCH] Fix the undefined variable file warning --- worldedit/compatibility.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/worldedit/compatibility.lua b/worldedit/compatibility.lua index c989a05..e0bd5ea 100644 --- a/worldedit/compatibility.lua +++ b/worldedit/compatibility.lua @@ -24,11 +24,14 @@ function worldedit.metasave(pos1, pos2, filename) return count end -function worldedit.metaload(originpos, filename) +function worldedit.metaload(originpos, file_name) deprecated("load") - filename = minetest.get_worldpath() .. "/schems/" .. file .. ".wem" - local file, err = io.open(filename, "wb") - if err then return 0 end + local file_path = minetest.get_worldpath() .. + "/schems/" .. file_name .. ".wem" + local file, err = io.open(file_path, "wb") + if err then + return 0 + end local data = file:read("*a") return worldedit.deserialize(originpos, data) end