mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-28 13:53:45 +01:00
Added comments
This commit is contained in:
parent
378b8f8f6c
commit
e53d9ec8d7
@ -362,15 +362,16 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- the following code is pulled from Minetest builtin without changes except for the call order being changed,
|
||||||
|
-- until a comment saying explicitly it's the end of such code
|
||||||
|
-- TODO if this gets a fix in the engine, remove the block of code
|
||||||
local function user_name(user)
|
local function user_name(user)
|
||||||
return user and user:get_player_name() or ""
|
return user and user:get_player_name() or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns a logging function. For empty names, does not log.
|
-- Returns a logging function. For empty names, does not log.
|
||||||
local function make_log(name)
|
local function make_log(name)
|
||||||
return name ~= "" and minetest.log or function() end
|
return name ~= "" and minetest.log or function() end
|
||||||
end
|
end
|
||||||
|
|
||||||
function minetest.node_dig(pos, node, digger)
|
function minetest.node_dig(pos, node, digger)
|
||||||
local diggername = user_name(digger)
|
local diggername = user_name(digger)
|
||||||
local log = make_log(diggername)
|
local log = make_log(diggername)
|
||||||
@ -474,6 +475,7 @@ function minetest.node_dig(pos, node, digger)
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
-- end of code pulled from Minetest
|
||||||
|
|
||||||
-- Drop single items by default
|
-- Drop single items by default
|
||||||
function minetest.item_drop(itemstack, dropper, pos)
|
function minetest.item_drop(itemstack, dropper, pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user