@@ -497,9 +497,10 @@ -- 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) @@ -529,9 +530,9 @@ -- 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