forked from MineClone5/MineClone5
#139 Fix crash on fly priv change for offline player
This commit is contained in:
parent
39f6500061
commit
5e58e71602
|
@ -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
|
Loading…
Reference in New Issue