set privs only when changed

setting privileges causes mt to write to the player db. this
changes shields so it only sets the interact privilege when
it has actually changed.
This commit is contained in:
cora 2022-01-30 01:07:26 +01:00
parent 5e58e71602
commit 8bfa248ef7
1 changed files with 4 additions and 2 deletions

View File

@ -182,8 +182,10 @@ end
local function set_interact(player, interact)
local player_name = player:get_player_name()
local privs = minetest.get_player_privs(player_name)
privs.interact = interact
minetest.set_player_privs(player_name, privs)
if privs.interact ~= interact then
privs.interact = interact
minetest.set_player_privs(player_name, privs)
end
end
local shield_hud = {}