Fix some undeclared global variables
This commit is contained in:
parent
6fb072e5ff
commit
128f0adb24
5 changed files with 19 additions and 20 deletions
|
@ -393,19 +393,19 @@ minetest.register_node("default:bookshelf", {
|
|||
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", default.bookshelf_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("books", 8*2)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.env:get_meta(pos);
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("books")
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if listname == "books" then
|
||||
if stack:get_name() == "default:book" then
|
||||
|
@ -417,7 +417,7 @@ minetest.register_node("default:bookshelf", {
|
|||
end,
|
||||
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.env:get_meta(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
local to_stack = inv:get_stack(to_list, to_index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue