Fix some undeclared global variables

master
Craig Davison 2014-11-26 22:48:43 +10:00 committed by Craig Robbins
parent 8df8554fce
commit dbae8a8854
2 changed files with 7 additions and 6 deletions

View File

@ -252,7 +252,7 @@ core.register_chatcommand("clearpassword", {
description = "set empty password", description = "set empty password",
privs = {password=true}, privs = {password=true},
func = function(name, param) func = function(name, param)
toname = param local toname = param
if toname == "" then if toname == "" then
return false, "Name field required" return false, "Name field required"
end end
@ -426,6 +426,7 @@ local function handle_give_command(cmd, giver, receiver, stackstring)
return false, receiver .. " is not a known player" return false, receiver .. " is not a known player"
end end
local leftover = receiverref:get_inventory():add_item("main", itemstack) local leftover = receiverref:get_inventory():add_item("main", itemstack)
local partiality
if leftover:is_empty() then if leftover:is_empty() then
partiality = "" partiality = ""
elseif leftover:get_count() == itemstack:get_count() then elseif leftover:get_count() == itemstack:get_count() then

View File

@ -30,7 +30,7 @@ core.register_entity(":__builtin:falling_node", {
item_texture = core.registered_items[itemname].inventory_image item_texture = core.registered_items[itemname].inventory_image
item_type = core.registered_items[itemname].type item_type = core.registered_items[itemname].type
end end
prop = { local prop = {
is_visible = true, is_visible = true,
textures = {node.name}, textures = {node.name},
} }
@ -112,7 +112,7 @@ core.register_entity(":__builtin:falling_node", {
}) })
function spawn_falling_node(p, node) function spawn_falling_node(p, node)
obj = core.add_entity(p, "__builtin:falling_node") local obj = core.add_entity(p, "__builtin:falling_node")
obj:get_luaentity():set_node(node) obj:get_luaentity():set_node(node)
end end
@ -163,10 +163,10 @@ end
-- --
function nodeupdate_single(p, delay) function nodeupdate_single(p, delay)
n = core.get_node(p) local n = core.get_node(p)
if core.get_item_group(n.name, "falling_node") ~= 0 then if core.get_item_group(n.name, "falling_node") ~= 0 then
p_bottom = {x=p.x, y=p.y-1, z=p.z} local p_bottom = {x=p.x, y=p.y-1, z=p.z}
n_bottom = core.get_node(p_bottom) local n_bottom = core.get_node(p_bottom)
-- Note: walkable is in the node definition, not in item groups -- Note: walkable is in the node definition, not in item groups
if core.registered_nodes[n_bottom.name] and if core.registered_nodes[n_bottom.name] and
(core.get_item_group(n.name, "float") == 0 or (core.get_item_group(n.name, "float") == 0 or