Replace more deprecated functions

This commit is contained in:
sfan5
2019-07-17 02:06:29 +02:00
parent b50294d10c
commit 0a16f11d93
3 changed files with 8 additions and 16 deletions

View File

@ -93,14 +93,6 @@ function worldedit.player_axis(name)
return "z", dir.z > 0 and 1 or -1
end
local function mkdir(path)
if minetest.mkdir then
minetest.mkdir(path)
else
os.execute('mkdir "' .. path .. '"')
end
end
local function check_filename(name)
return name:find("^[%w%s%^&'@{}%[%],%$=!%-#%(%)%%%.%+~_]+$") ~= nil
end
@ -1115,7 +1107,7 @@ minetest.register_chatcommand("/save", {
local path = minetest.get_worldpath() .. "/schems"
-- Create directory if it does not already exist
mkdir(path)
minetest.mkdir(path)
local filename = path .. "/" .. param .. ".we"
local file, err = io.open(filename, "wb")
@ -1282,7 +1274,7 @@ minetest.register_chatcommand("/mtschemcreate", {
local path = minetest.get_worldpath() .. "/schems"
-- Create directory if it does not already exist
mkdir(path)
minetest.mkdir(path)
local filename = path .. "/" .. param .. ".mts"
local ret = minetest.create_schematic(worldedit.pos1[name],