1
0
mirror of https://github.com/Sokomine/cottages.git synced 2025-07-10 11:50:23 +02:00

compatibility w/ broken tools

This commit is contained in:
flux
2023-03-29 15:51:33 -07:00
parent 549c697bc0
commit cb9a744a1b
4 changed files with 29 additions and 2 deletions

View File

@ -18,6 +18,7 @@ local v_sub = vector.subtract
local get_safe_short_description = cottages.util.get_safe_short_description
local resolve_item = cottages.util.resolve_item
local has_broken_tools = cottages.has.broken_tools
local has_stamina = cottages.has.stamina
local repair_amount = cottages.settings.anvil.repair_amount
@ -185,6 +186,11 @@ function anvil.use_anvil(pos, puncher)
-- do the actual repair
tool:add_wear(-repair_amount)
if has_broken_tools then
broken_tools.fix_tool(tool)
end
inv:set_stack("input", 1, tool)
-- damage the hammer slightly