Improve luacheck, remove some unused variables
parent
80c492fd23
commit
575bc0c119
|
@ -15,10 +15,12 @@ read_globals = {
|
|||
|
||||
-- Minetest
|
||||
"minetest",
|
||||
"core",
|
||||
"vector",
|
||||
"VoxelManip",
|
||||
|
||||
-- deps
|
||||
"default", "screwdriver",
|
||||
"farming", "armor",
|
||||
"mcl_core", "mcl_sounds",
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
3
init.lua
3
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<elevator.SLOW_DIST) then
|
||||
speed = elevator.SLOW_SPEED
|
||||
|
@ -147,7 +147,6 @@ elevator.build_motor = function(hash)
|
|||
end
|
||||
|
||||
elevator.unbuild = function(pos, add)
|
||||
local need_saving = false
|
||||
local p = table.copy(pos)
|
||||
p.y = p.y - 1
|
||||
-- Loop down through the network, set any elevators below this to the off position.
|
||||
|
|
Loading…
Reference in New Issue