mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
[mcl_item_entity] fix warnings
This commit is contained in:
parent
8286fd2a4d
commit
fddaacdeae
2 changed files with 10 additions and 17 deletions
|
@ -426,13 +426,9 @@ minetest.register_entity(":__builtin:item", {
|
|||
if itemtable then
|
||||
itemname = stack:to_table().name
|
||||
end
|
||||
local item_texture = nil
|
||||
local item_type = ""
|
||||
local glow
|
||||
local def = minetest.registered_items[itemname]
|
||||
if def then
|
||||
item_texture = def.inventory_image
|
||||
item_type = def.type
|
||||
description = def.description
|
||||
glow = def.light_source
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
local vector = vector
|
||||
|
||||
function mcl_minecarts:get_sign(z)
|
||||
if z == 0 then
|
||||
return 0
|
||||
|
@ -38,11 +40,9 @@ end
|
|||
|
||||
function mcl_minecarts:check_front_up_down(pos, dir_, check_down, railtype)
|
||||
local dir = vector.new(dir_)
|
||||
local cur = nil
|
||||
|
||||
-- Front
|
||||
dir.y = 0
|
||||
cur = vector.add(pos, dir)
|
||||
local cur = vector.add(pos, dir)
|
||||
if mcl_minecarts:is_rail(cur, railtype) then
|
||||
return dir
|
||||
end
|
||||
|
@ -65,7 +65,7 @@ end
|
|||
|
||||
function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype)
|
||||
local pos = vector.round(pos_)
|
||||
local cur = nil
|
||||
local cur
|
||||
local left_check, right_check = true, true
|
||||
|
||||
-- Check left and right
|
||||
|
@ -122,7 +122,6 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype)
|
|||
return cur
|
||||
end
|
||||
end
|
||||
|
||||
-- Backwards
|
||||
if not old_switch then
|
||||
cur = mcl_minecarts:check_front_up_down(pos, {
|
||||
|
@ -134,7 +133,5 @@ function mcl_minecarts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype)
|
|||
return cur
|
||||
end
|
||||
end
|
||||
|
||||
return {x=0, y=0, z=0}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue