mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-06-28 04:50:21 +02:00
Fix calls to check_player_privs with player name instead of player userdata
Fixes #357
This commit is contained in:
@ -129,8 +129,9 @@ minetest.register_node("itemframes:frame",{
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
if not itemstack then return end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if clicker:get_player_name() == meta:get_string("owner") or
|
||||
minetest.check_player_privs(clicker, "protection_bypass") then
|
||||
local name = clicker and clicker:get_player_name()
|
||||
if name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(name, "protection_bypass") then
|
||||
drop_item(pos,node)
|
||||
local s = itemstack:take_item()
|
||||
meta:set_string("item",s:to_string())
|
||||
@ -140,8 +141,9 @@ minetest.register_node("itemframes:frame",{
|
||||
end,
|
||||
on_punch = function(pos,node,puncher)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if puncher:get_player_name() == meta:get_string("owner") or
|
||||
minetest.check_player_privs(puncher, "protection_bypass") then
|
||||
local name = puncher and puncher:get_player_name()
|
||||
if name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(name, "protection_bypass") then
|
||||
drop_item(pos, node)
|
||||
end
|
||||
end,
|
||||
@ -150,7 +152,7 @@ minetest.register_node("itemframes:frame",{
|
||||
local name = player and player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
return name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(player, "protection_bypass")
|
||||
minetest.check_player_privs(name, "protection_bypass")
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -190,8 +192,9 @@ minetest.register_node("itemframes:pedestal",{
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
if not itemstack then return end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if clicker:get_player_name() == meta:get_string("owner") or
|
||||
minetest.check_player_privs(clicker, "protection_bypass") then
|
||||
local name = clicker and clicker:get_player_name()
|
||||
if name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(name, "protection_bypass") then
|
||||
drop_item(pos,node)
|
||||
local s = itemstack:take_item()
|
||||
meta:set_string("item",s:to_string())
|
||||
@ -201,8 +204,9 @@ minetest.register_node("itemframes:pedestal",{
|
||||
end,
|
||||
on_punch = function(pos,node,puncher)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if puncher:get_player_name() == meta:get_string("owner") or
|
||||
minetest.check_player_privs(puncher, "protection_bypass") then
|
||||
local name = puncher and puncher:get_player_name()
|
||||
if name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(name, "protection_bypass") then
|
||||
drop_item(pos,node)
|
||||
end
|
||||
end,
|
||||
@ -211,7 +215,7 @@ minetest.register_node("itemframes:pedestal",{
|
||||
local name = player and player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
return name == meta:get_string("owner") or
|
||||
minetest.check_player_privs(player, "protection_bypass")
|
||||
minetest.check_player_privs(name, "protection_bypass")
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
Reference in New Issue
Block a user