Fix another bug

The first cloaked player would not become cloaked.
This commit is contained in:
luk3yx 2018-04-04 07:20:15 +12:00
parent a35742bd5c
commit d3311e6fc3
1 changed files with 6 additions and 4 deletions

View File

@ -85,11 +85,13 @@ local override_chatcommands = function()
for _, func in ipairs(minetest.registered_on_leaveplayers) do
c = c + 1
local f = func
minetest.registered_on_leaveplayers[c] = function(p, timed_out, cloaked)
if not cloaked and cloaked_players[p:get_player_name()] then
return
if f ~= cloaking.auto_uncloak then
minetest.registered_on_leaveplayers[c] = function(p, t, cloaked)
if not cloaked and cloaked_players[p:get_player_name()] then
return
end
return f(p, t)
end
return f(p, timed_out)
end
end
end