Can't assign attributes to offline players like this.
Assign them only when online instead. This needs a rewrite.
This commit is contained in:
parent
22a4490ffc
commit
a82776cd81
@ -434,7 +434,11 @@ local function grant_perks(box_id, boxes)
|
||||
end
|
||||
end
|
||||
if accepted >= 3 then
|
||||
local limit = tonumber(builder:get_attribute("box_create_limit") or "3")
|
||||
local player = minetest.get_player_by_name(builder)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local limit = tonumber(player:get_attribute("box_create_limit") or "3")
|
||||
if limit <= 3 then
|
||||
minetest.log("perks: granted more boxes to " .. builder)
|
||||
announce.all(builder .. " has been granted the more boxes perk!")
|
||||
@ -452,7 +456,7 @@ local function grant_perks(box_id, boxes)
|
||||
"--sofar"
|
||||
}
|
||||
})
|
||||
builder:set_attribute("box_create_limit", "5")
|
||||
player:set_attribute("box_create_limit", "5")
|
||||
end
|
||||
end
|
||||
if accepted >= 5 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user