Properly check for nil - tonumber will emit it.
This caused a few crashes on people using the creator pad.
This commit is contained in:
parent
5a9e1286cd
commit
6af528b74f
@ -631,7 +631,7 @@ do_creator_if = function(player, context)
|
||||
end
|
||||
|
||||
local pmeta = player:get_meta()
|
||||
local limit = tonumber(pmeta:get_string("box_create_limit") or "3")
|
||||
local limit = tonumber(pmeta:get_string("boxxx_create_limit")) or 3
|
||||
|
||||
if (minetest.check_player_privs(name, "create") and counts.editing + counts.submitted <= limit) or
|
||||
minetest.check_player_privs(name, "review") then
|
||||
|
@ -74,7 +74,7 @@ function perks.grant(name_or_player)
|
||||
|
||||
if accepted >= 3 then
|
||||
local pmeta = player:get_meta()
|
||||
local limit = tonumber(pmeta:get_string("box_create_limit") or "3")
|
||||
local limit = tonumber(pmeta:get_string("box_create_limit") or 3
|
||||
if limit <= 3 then
|
||||
minetest.log("perks: granted more boxes to " .. name)
|
||||
announce.all(name .. " has been granted the more boxes perk!")
|
||||
|
Loading…
x
Reference in New Issue
Block a user