Skip to content

Commit

Permalink
Exception for wooden swords and daggers in repair kits to bring them …
Browse files Browse the repository at this point in the history
…back to carpentry where they belong
  • Loading branch information
brightrim committed Oct 13, 2023
1 parent d0dd0a3 commit c00a7de
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions craft/repairs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ local smithedTools = {Item.scissors, Item.saw, Item.hammer, Item.shovel, Item.ne

local woodenTools = {Item.fishingRod, Item.rollingPin, Item.peel, Item.cookingSpoon, Item.flail, Item.candleMould, Item.brickMould, Item.collectionPan, Item.dyeingRod, Item.woodenShovel}

local woodenWeapons = {Item.woodenSword, Item.woodenDagger}

local function itemIsSameCategoryAsRepairKit(currentItem, skillName)

local armourFound, armour = world:getArmorStruct(currentItem.id)
Expand All @@ -156,6 +158,14 @@ local function itemIsSameCategoryAsRepairKit(currentItem, skillName)
end
end

for index , woodenWeapon in ipairs(woodenWeapons) do
if woodenWeapon == currentItem.id and skillName == "carpentry" then
return true
elseif woodenWeapon == currentItem.id then
return false --If it isn't carpentry but is the wooden weapon, we return false here so that it doesn't get repaired by blacksmithing tools also as a weapon below
end
end

if currentItem.id == Item.crown or currentItem.id == Item.diadem or currentItem.id == 3556 or currentItem.id == 3557 then -- crowns are added as an exception as they are clothing but do not belong to tailoring
if skillName == "finesmithing" then
return true
Expand Down

0 comments on commit c00a7de

Please sign in to comment.