#139 Fix crash on fly priv change for offline player

This commit is contained in:
kay27 2022-01-26 03:35:05 +04:00
parent 39f6500061
commit 5e58e71602
1 changed files with 4 additions and 2 deletions

View File

@ -22,8 +22,10 @@ for _, action in pairs({"grant", "revoke"}) do
minetest["register_on_priv_" .. action](function(name, _, priv) minetest["register_on_priv_" .. action](function(name, _, priv)
if priv == "fly" then if priv == "fly" then
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local meta = player:get_meta() if player then
meta:set_int("fly_changed", 1) local meta = player:get_meta()
meta:set_int("fly_changed", 1)
end
end end
end) end)
end end