sorcery  Check-in [032f54d1d5]

Overview
Comment:bugfixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: 032f54d1d58eb85ec500ddbc7078218ca96cc1c6cbbc72e3582ff305fede64bf
User & Date: lexi on 2024-03-17 00:35:03
Other Links: manifest | tags
Context
2024-03-17
00:35
bugfixes Leaf check-in: 032f54d1d5 user: lexi tags: trunk
2022-03-18
01:50
updates check-in: 4b5ada2414 user: lexi tags: trunk
Changes

Modified potions.lua from [4d3cea5840] to [caa667dc69].

   193    193   				max_hear_distance = 12;
   194    194   			}, true)
   195    195   			local ret = ItemStack("vessels:glass_bottle")
   196    196   			if stack:is_empty() then stack = ret else
   197    197   				if user:get_inventory():room_for_item('main',ret) then
   198    198   					user:get_inventory():add_item('main',ret)
   199    199   				else
   200         -					minetest.add_item(user.get_pos(), ret)
          200  +					minetest.add_item(user:get_pos(), ret)
   201    201   				end
   202    202   			end
   203    203   			return stack
   204    204   		end
   205    205   	}
   206    206   	local fullname = potion.name .. ' Draught'
   207    207   	sorcery.register_potion(name, fullname,

Modified writing.lua from [cf9865540e] to [0d6f78a1ee].

   494    494   				end
   495    495   			end
   496    496   
   497    497   			-- handle editing request
   498    498   			local rpp = sorcery.cookbook.constants.recipes_per_cookbook_page 
   499    499   			if p.mode then for idx=1,rpp do
   500    500   				if fields['recipe_' .. tostring(idx)] then
   501         -					local recnr = (bm:get_int('pagenr')-1)*rpp + idx
          501  +					local pg = math.max(1, bm:get_int 'pagenr') -- handle unset page
          502  +					local recnr = (pg-1)*rpp + idx
   502    503   					local rec = book.pages[recnr]
   503    504   					local bookchanged = false 
   504    505   					if p.mode == 'delete' then
   505    506   						p.operstack:take_item(1)
   506    507   						table.remove(book.pages,recnr)
   507    508   						bookchanged = true
   508    509   					elseif p.mode == 'copy' and
................................................................................
   526    527   							name = rm:get_string('recipe_name');
   527    528   						})
   528    529   						-- insertion can operate in one of two modes: copying
   529    530   						-- the recipe into the book, or inserting the paper
   530    531   						-- directly. if there is no ink available, we use the
   531    532   						-- latter mode. in effect, this means deleting the
   532    533   						-- recipe item is insufficient ink is available.
   533         -						if charge_ink(constants.op_cost_insert_rec) == false then
          534  +						if (not p.has_pen) or charge_ink(constants.op_cost_insert_rec) == false then
   534    535   							p.operstack = ItemStack(nil)
   535    536   						end
   536    537   						bookchanged = true
   537    538   					elseif p.mode == 'cut' then
   538    539   						local spr = p.operstack:get_definition()._sorcery
   539    540   						local sch = (spr and spr.material and spr.material.data.hardness) or 2
   540    541   						local suses = sch * constants.cuts_per_scissor_hardness