Skip to content

Commit ca46261

Browse files
authored
Merge pull request #1585 from chdoc/fix-ethics-wood
`caravan`: fix special case for obsidian swords
2 parents 7edfa23 + 9fe3c1b commit ca46261

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Template for new versions:
3333
## Fixes
3434
- `gui/siegemanager`: consistently set the initial filter to "All"
3535

36+
- `caravan`: fix ethics warning for wooden weapons
37+
3638
## Misc Improvements
3739

3840
## Removed

internal/caravan/common.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,14 @@ local function is_wood_based_item(item)
682682
return mi and mi.mode == 'creature'
683683
elseif itype == df.item_type.LIQUID_MISC then
684684
return mat_type == df.builtin_mats.LYE
685-
elseif itype == df.item_type.WEAPON then
685+
end
686+
687+
-- detect obsidian short swords
688+
if itype == df.item_type.WEAPON then
686689
local mi = dfhack.matinfo.decode(mat_type, mat_index)
687-
return mi and mi.mode == 'inorganic' and mi.material and not mi.material.flags.IS_METAL
690+
if mi and mi.mode == 'inorganic' and mi.material and not mi.material.flags.IS_METAL then
691+
return true
692+
end
688693
end
689694

690695
return is_wood_based_material(mat_type, mat_index)

0 commit comments

Comments
 (0)