forked from VoxeLibre/VoxeLibre
Fix typo and interact bug?
This commit is contained in:
parent
63a156c30c
commit
6afe7cfb58
|
@ -204,9 +204,10 @@ local function set_interact(player, interact)
|
|||
return
|
||||
end
|
||||
local meta = player:get_meta()
|
||||
if meta:get_int("ineract_revoked") ~= 1 then
|
||||
if meta:get_int("mcl_privs:interact_revoked") ~= 1 then
|
||||
privs.interact = interact
|
||||
minetest.set_player_privs(player_name, privs)
|
||||
meta:set_int("mcl_privs:interact_revoked",0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ minetest.register_privilege("maphack", {
|
|||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
local meta = player:get_meta()
|
||||
if meta:get_int("fly_changed") == 1 then return end
|
||||
if meta:get_int("mcl_privs:fly_changed") == 1 then return end
|
||||
|
||||
local fly = nil
|
||||
if minetest.is_creative_enabled(name) then
|
||||
|
@ -21,24 +21,25 @@ end)
|
|||
for _, action in pairs({"grant", "revoke"}) do
|
||||
minetest["register_on_priv_" .. action](function(name, _, priv)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
local meta = player:get_meta()
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
|
||||
if priv == "fly" then
|
||||
meta:set_int("fly_changed", 1)
|
||||
end
|
||||
local meta = player:get_meta()
|
||||
|
||||
if priv == "fly" then
|
||||
meta:set_int("mcl_privs:fly_changed", 1)
|
||||
end
|
||||
|
||||
--[[
|
||||
so e.g. hackers who have been revoked of the interact privilege
|
||||
will not automatically get the interact privilege through the mcl shields code back
|
||||
]]
|
||||
|
||||
if priv == "interact" then
|
||||
if action == "revoke" then
|
||||
meta:set_int("ineract_revoked", 1)
|
||||
else
|
||||
meta:set_int("ineract_revoked", 0)
|
||||
end
|
||||
--[[
|
||||
so e.g. hackers who have been revoked of the interact privilege
|
||||
will not automatically get the interact privilege through the mcl shields code back
|
||||
]]
|
||||
if priv == "interact" then
|
||||
if action == "revoke" then
|
||||
meta:set_int("mcl_privs:interact_revoked", 1)
|
||||
else
|
||||
meta:set_int("mcl_privs:interact_revoked", 0)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue