sorcery  context.lua at [58edda50fc]

File context.lua artifact 4a989c354e part of check-in 58edda50fc


sorcery.ctx = {
	users = {};
	get = function(uo)
		local name = uo:get_player_name()
		if sorcery.ctx.users[name] == nil then
			sorcery.ctx.users[name] = {}
		end
		return sorcery.ctx.users[name]
	end;
	stat = function(uo)
		local name = uo:get_player_name()
		return (sorcery.ctx.users[name] ~= nil)
	end;
}

minetest.register_on_leaveplayer(function(obj)
	local name = obj:get_player_name()
	if sorcery.ctx.users[name] then
		sorcery.ctx.users[name] = nil
	end
end)