Fix many, many warnings

This commit is contained in:
Panquesito7 2020-02-06 19:42:52 -06:00
parent 69bb0e4185
commit 08879e9c28
No known key found for this signature in database
GPG Key ID: 3C482B03FD220E68
6 changed files with 37 additions and 47 deletions

View File

@ -54,7 +54,6 @@ worldedit.cuboid_linear_expand = function(name, axis, direction, amount)
return true
end
-- Shifts the cuboid by '+-amount' in axis 'axis'
worldedit.cuboid_shift = function(name, axis, amount)
local pos1 = worldedit.pos1[name]
@ -113,7 +112,6 @@ worldedit.marker_update = function(name, marker)
end
end
-- Returns two vectors with the directions for volumetric expansion
worldedit.get_expansion_directions = function(mark1, mark2)
if mark1 == nil or mark2 == nil then
@ -146,7 +144,6 @@ worldedit.get_expansion_directions = function(mark1, mark2)
return dir1, dir2
end
-- Return the marker that is closest to the player
worldedit.marker_get_closest_to_player = function(name)
local playerpos = minetest.get_player_by_name(name):get_pos()
@ -160,7 +157,6 @@ worldedit.marker_get_closest_to_player = function(name)
end
end
-- Returns the closest marker to the specified axis and direction
worldedit.marker_get_closest_to_axis = function(name, axis, direction)
local pos1 = vector.new()
@ -199,7 +195,6 @@ worldedit.marker_get_closest_to_axis = function(name, axis, direction)
end
end
-- Translates up, down, left, right, front, back to their corresponding axes and
-- directions according to faced direction
worldedit.translate_direction = function(name, direction)

View File

@ -15,8 +15,6 @@ local ver = {major=1, minor=2}
worldedit.version = ver
worldedit.version_string = string.format("%d.%d", ver.major, ver.minor)
local path = minetest.get_modpath(minetest.get_current_modname())
local function load_module(path)
local file = io.open(path, "r")
if not file then return end
@ -24,6 +22,8 @@ local function load_module(path)
return dofile(path)
end
local path = minetest.get_modpath(minetest.get_current_modname())
dofile(path .. "/common.lua")
load_module(path .. "/manipulations.lua")
load_module(path .. "/primitives.lua")

View File

@ -217,8 +217,6 @@ function worldedit.copy2(pos1, pos2, off, meta_backwards)
dst_manip:set_param2_data(dst_data)
mh.finish(dst_manip)
src_data = nil
dst_data = nil
-- Copy metadata
local get_meta = minetest.get_meta

View File

@ -299,7 +299,6 @@ function worldedit.spiral(pos, length, height, spacer, node_name)
for index = 1, segment_length do
-- Move along the direction of the segment
i = i + stride_axis * sign
local column = i
-- Add column
for y = 1, height do
data[column] = node_id
@ -314,7 +313,6 @@ function worldedit.spiral(pos, length, height, spacer, node_name)
sign = -sign
for index = 1, segment_length do
i = i + stride_axis * sign
local column = i
-- Add column
for y = 1, height do
data[column] = node_id

View File

@ -45,14 +45,14 @@ local function chatcommand_handler(cmd_name, name, param)
if def.nodes_needed then
local count = def.nodes_needed(name, unpack(parsed))
safe_region(name, count, function()
local success, msg = def.func(name, unpack(parsed))
local msg = def.func(name, unpack(parsed))
if msg then
minetest.chat_send_player(name, msg)
end
end)
else
-- no "safe region" check
local success, msg = def.func(name, unpack(parsed))
local msg = def.func(name, unpack(parsed))
if msg then
minetest.chat_send_player(name, msg)
end
@ -243,7 +243,6 @@ worldedit.register_command("help", {
return false, "You are not allowed to use any WorldEdit commands."
end
if param == "" then
local msg = ""
local cmds = {}
for cmd, def in pairs(worldedit.registered_commands) do
if minetest.check_player_privs(name, def.privs) then

View File

@ -4,11 +4,11 @@ worldedit = worldedit or {}
Example:
worldedit.register_gui_function("worldedit_gui_hollow_cylinder", {
name = "Make Hollow Cylinder",
privs = {worldedit=true},
get_formspec = function(name) return "some formspec here" end,
on_select = function(name) print(name .. " clicked the button!") end,
})
name = "Make Hollow Cylinder",
privs = {worldedit=true},
get_formspec = function(name) return "some formspec here" end,
on_select = function(name) print(name .. " clicked the button!") end,
})
Use `nil` for the `options` parameter to unregister the function associated with the given identifier.
@ -35,7 +35,7 @@ end
Example:
worldedit.register_gui_handler("worldedit_gui_hollow_cylinder", function(name, fields)
print(minetest.serialize(fields))
print(minetest.serialize(fields))
end)
]]
@ -88,7 +88,7 @@ if minetest.global_exists("unified_inventory") then -- unified inventory install
worldedit.show_page(name, "worldedit_gui")
return true
elseif fields.worldedit_gui_exit then --return to original page
local player = minetest.get_player_by_name(name)
player = minetest.get_player_by_name(name)
if player then
unified_inventory.set_inventory_formspec(player, "craft")
end