From 575bc0c119f9aa61c5e24411ad46701c52e17a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 1 May 2020 23:01:15 +0200 Subject: Improve luacheck, remove some unused variables --- .luacheckrc | 2 ++ helpers.lua | 2 +- init.lua | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index db7f279..67f13ed 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -15,10 +15,12 @@ read_globals = { -- Minetest "minetest", + "core", "vector", "VoxelManip", -- deps "default", "screwdriver", "farming", "armor", + "mcl_core", "mcl_sounds", } diff --git a/helpers.lua b/helpers.lua index ccd8ebb..2df4253 100644 --- a/helpers.lua +++ b/helpers.lua @@ -13,7 +13,7 @@ elevator.teleport_player_from_elevator = function(player) if node.name == "elevator:elevator_on" then local front = vector.subtract(pos, minetest.facedir_to_dir(node.param2)) local front_above = vector.add(front, {x=0, y=1, z=0}) - local front_below = vector.subtract(front, {x=0, y=1, z=0}) + -- local front_below = vector.subtract(front, {x=0, y=1, z=0}) -- If the front isn't solid, it's ok to teleport the player. if not solid(front) and not solid(front_above) then player:setpos(front) diff --git a/init.lua b/init.lua index eee4d8a..68f79d4 100644 --- a/init.lua +++ b/init.lua @@ -53,7 +53,7 @@ elevator.create_box = function(motorhash, pos, target, sender) obj:get_luaentity().vmult = (target.y < pos.y) and -1 or 1 -- FIX for "overshooting" local delta_y = math.abs(pos.y-target.y) - + local speed = elevator.SPEED if (delta_y