sorcery  Diff

Differences From Artifact [4b9992727f]:

To Artifact [1bf06d7139]:


   707    707   	local stack = uinv:get_stack('main', idx)
   708    708   	local book = bookprops(stack)
   709    709   	local meta = stack:get_meta()
   710    710   
   711    711   	local curpage = meta:contains("pagenr") and meta:get_int("pagenr") or 1
   712    712   	local pagect = math.ceil(#book.pages / constants.recipes_per_cookbook_page)
   713    713   
   714         -	if curpage > 1 and fields.pageback then
   715         -		meta:set_int('pagenr', curpage - 1)
   716         -	elseif curpage < pagect and fields.pagenext then
   717         -		meta:set_int('pagenr', curpage + 1)
          714  +	if fields.pageback or fields.pagenext then
          715  +		if curpage > 1 and fields.pageback then
          716  +			meta:set_int('pagenr', curpage - 1)
          717  +		elseif curpage < pagect and fields.pagenext then
          718  +			meta:set_int('pagenr', curpage + 1)
          719  +		end
          720  +		minetest.sound_play('sorcery_pgturn', { pos = pos, gain = 0.6 })
   718    721   	end
   719    722   
   720    723   	uinv:set_stack('main',idx,stack)
   721    724   	bookform(stack,user)
   722    725   end)
   723    726   
   724    727   minetest.register_on_craft(function(stack,player,grid,inv)