Index: potions.lua ================================================================== --- potions.lua +++ potions.lua @@ -195,11 +195,11 @@ local ret = ItemStack("vessels:glass_bottle") if stack:is_empty() then stack = ret else if user:get_inventory():room_for_item('main',ret) then user:get_inventory():add_item('main',ret) else - minetest.add_item(user.get_pos(), ret) + minetest.add_item(user:get_pos(), ret) end end return stack end } Index: writing.lua ================================================================== --- writing.lua +++ writing.lua @@ -496,11 +496,12 @@ -- handle editing request local rpp = sorcery.cookbook.constants.recipes_per_cookbook_page if p.mode then for idx=1,rpp do if fields['recipe_' .. tostring(idx)] then - local recnr = (bm:get_int('pagenr')-1)*rpp + idx + local pg = math.max(1, bm:get_int 'pagenr') -- handle unset page + local recnr = (pg-1)*rpp + idx local rec = book.pages[recnr] local bookchanged = false if p.mode == 'delete' then p.operstack:take_item(1) table.remove(book.pages,recnr) @@ -528,11 +529,11 @@ -- insertion can operate in one of two modes: copying -- the recipe into the book, or inserting the paper -- directly. if there is no ink available, we use the -- latter mode. in effect, this means deleting the -- recipe item is insufficient ink is available. - if charge_ink(constants.op_cost_insert_rec) == false then + if (not p.has_pen) or charge_ink(constants.op_cost_insert_rec) == false then p.operstack = ItemStack(nil) end bookchanged = true elseif p.mode == 'cut' then local spr = p.operstack:get_definition()._sorcery