mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 18:20:36 +01:00
Added security in intweak
- Punching things with unknown items was making server crash
This commit is contained in:
parent
fd7c1c2980
commit
0899d85dac
@ -37,6 +37,7 @@ minetest.register_on_punchnode(function(pos, node, puncher)
|
|||||||
if minetest.setting_getbool("creative_mode") then return end
|
if minetest.setting_getbool("creative_mode") then return end
|
||||||
local pn = puncher:get_player_name()
|
local pn = puncher:get_player_name()
|
||||||
tools[pn] = puncher:get_wielded_item():get_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
|
ttyp[pn] = minetest.registered_items[tools[pn]].type
|
||||||
local left = puncher:get_wielded_item():get_wear() + 65535/65--)
|
local left = puncher:get_wielded_item():get_wear() + 65535/65--)
|
||||||
local tab = minetest.registered_tools[tools[pn]]
|
local tab = minetest.registered_tools[tools[pn]]
|
||||||
|
Loading…
Reference in New Issue
Block a user