Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e807bf0

Browse files
davisonioZeno-
authored andcommittedNov 26, 2014
Fix some undeclared global variables
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
1 parent 8df8554 commit e807bf0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
 

‎builtin/game/chatcommands.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ core.register_chatcommand("clearpassword", {
252252
description = "set empty password",
253253
privs = {password=true},
254254
func = function(name, param)
255-
toname = param
255+
local toname = param
256256
if toname == "" then
257257
return false, "Name field required"
258258
end
@@ -426,6 +426,7 @@ local function handle_give_command(cmd, giver, receiver, stackstring)
426426
return false, receiver .. " is not a known player"
427427
end
428428
local leftover = receiverref:get_inventory():add_item("main", itemstack)
429+
local partiality = nil
429430
if leftover:is_empty() then
430431
partiality = ""
431432
elseif leftover:get_count() == itemstack:get_count() then

‎builtin/game/falling.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ core.register_entity(":__builtin:falling_node", {
3030
item_texture = core.registered_items[itemname].inventory_image
3131
item_type = core.registered_items[itemname].type
3232
end
33-
prop = {
33+
local prop = {
3434
is_visible = true,
3535
textures = {node.name},
3636
}
@@ -112,7 +112,7 @@ core.register_entity(":__builtin:falling_node", {
112112
})
113113

114114
function spawn_falling_node(p, node)
115-
obj = core.add_entity(p, "__builtin:falling_node")
115+
local obj = core.add_entity(p, "__builtin:falling_node")
116116
obj:get_luaentity():set_node(node)
117117
end
118118

@@ -163,10 +163,10 @@ end
163163
--
164164

165165
function nodeupdate_single(p, delay)
166-
n = core.get_node(p)
166+
local n = core.get_node(p)
167167
if core.get_item_group(n.name, "falling_node") ~= 0 then
168-
p_bottom = {x=p.x, y=p.y-1, z=p.z}
169-
n_bottom = core.get_node(p_bottom)
168+
local p_bottom = {x=p.x, y=p.y-1, z=p.z}
169+
local n_bottom = core.get_node(p_bottom)
170170
-- Note: walkable is in the node definition, not in item groups
171171
if core.registered_nodes[n_bottom.name] and
172172
(core.get_item_group(n.name, "float") == 0 or

0 commit comments

Comments
 (0)
Please sign in to comment.