Cleanup unused vars in items.lua

This commit is contained in:
Hugues Ross 2020-06-01 18:00:53 -04:00
parent a9aa8d1891
commit bb03fd547b

View File

@ -19,7 +19,7 @@ local function show_map_id_formspec(id, player_x, player_z, player_name, height_
local map = cartographer.get_map(id);
player_x, player_z = cartographer.to_map_coordinates(map, player_x, player_z)
local formspec, formspec_width, formspec_height = cartographer.get_map_formspec_map(map, player_x, player_z, height_mode);
local formspec, formspec_width, _ = cartographer.get_map_formspec_map(map, player_x, player_z, height_mode);
if #_cartographer.marker_lookup > 0 then
formspec = formspec .. string.format("style_type[button,image_button,label;noclip=true] container[%f,1.0]", formspec_width - 0.01)
.. _cartographer.generate_marker_formspec(cartographer.get_marker(map, player_x, player_z), map.detail, marker_page or 1, cartographer.skin.marker_bg, cartographer.skin.marker_button)
@ -92,7 +92,7 @@ minetest.register_on_player_receive_fields(function(player, name, fields)
return;
end
for k,v in pairs(fields) do
for k,_ in pairs(fields) do
local marker = k:match("marker%-(.+)");
local pos = player:get_pos();
if marker or k == "clear_marker" then
@ -141,10 +141,8 @@ minetest.register_node("cartographer:map", {
-- Called when this node is placed in the world. Copies map data from the
-- item to the node.
-- pos: The position of the node
-- placer: The object that placed this node (can be nil)
-- stack: The itemstack that was placed
-- pointed_thing: The current pointed thing
after_place_node = function(pos, placer, stack, pointed_thing)
after_place_node = function(pos, _, stack, _)
local meta = stack:get_meta():to_table();
local node_meta = minetest.get_meta(pos);
node_meta:from_table(meta);
@ -224,11 +222,10 @@ function cartographer.copy_map_item(stack)
local copy_meta = copy:get_meta();
local id = meta:get_int("cartographer:map_id");
local new_id = 0;
if id > 0 then
local src = cartographer.get_map(id);
new_id = cartographer.create_map(src.x, src.z, src.w, src.h, false, src.detail, src.scale);
local new_id = cartographer.create_map(src.x, src.z, src.w, src.h, false, src.detail, src.scale);
local dest = cartographer.get_map(new_id);
for k,v in pairs(src.fill) do
dest.fill[k] = v;