1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

Added security in intweak

- Punching things with unknown items was making server crash
This commit is contained in:
LeMagnesium 2015-02-14 17:17:48 +01:00
parent fd7c1c2980
commit 0899d85dac

View File

@ -37,6 +37,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
if minetest.setting_getbool("creative_mode") then return end
local pn = puncher:get_player_name()
tools[pn] = puncher:get_wielded_item():get_name()
if minetest.registred_items[tools[pn]] == nil then return end
ttyp[pn] = minetest.registered_items[tools[pn]].type
local left = puncher:get_wielded_item():get_wear() + 65535/65--)
local tab = minetest.registered_tools[tools[pn]]