Fix crash on userlimit callback not returning a boolean

This commit is contained in:
rubenwardy 2018-01-03 01:44:24 +00:00
parent 68cea916ce
commit c84e8f8610

View file

@ -3,6 +3,6 @@ minetest.register_can_bypass_userlimit(function(name, ip)
local actual_max_users = tonumber(minetest.settings:get("max_users")) +
tonumber(minetest.settings:get("max_extra_users") or "10")
local req_score = tonumber(minetest.settings:get("userlimit_bypass_required_score") or "10000")
return pstat and pstat.score > req_score and #minetest.get_connected_players() < actual_max_users
local can_connect = pstat and pstat.score > req_score and #minetest.get_connected_players() < actual_max_users
return can_connect and true or false
end)