sorcery  context.lua at [f165d9e39f]

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


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)