Skip to content

combine: differentiate dyes by dye_profile instead of excluding them - #1617

Open
Alistair-Afton wants to merge 2 commits into
DFHack:masterfrom
Alistair-Afton:combine-dye-profile
Open

Alistair-Afton wants to merge 2 commits into
DFHack:masterfrom
Alistair-Afton:combine-dye-profile

Conversation

@Alistair-Afton

@Alistair-Afton Alistair-Afton commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Removes the blanket exclusion of dye powders from combine (the previous mitigation for DFHack/dfhack#5849) and instead includes a dye_profile fingerprint in the item comparison key.

Identical dye mixtures still stack; distinct mixtures stay separate, fixing the information loss where mixed dyes merged back into their components.

combine.lua is now loadable as a module and exposes unit_test_hooks for the comparison-key logic. Five new in-engine tests in test/combine.lua; changelog updated.

Testing

  • test/combine.lua: 5/5 tests pass in-game
  • combine --dry-run verified against a live fort
  • ci/lint.py clean

Blanket-excluding dyes prevented combining them at all. Mixed dyes share
mat_type/mat_index with their components, so keying POWDER_MISC items on
the dye_profile fingerprint keeps mixes distinct while allowing
identical dyes to stack.

fixes DFHack/dfhack#5849
@ab9rf

ab9rf commented Sep 15, 2026

Copy link
Copy Markdown
Member

There are unfixed vanilla game bugs regarding dyes with incorrect or missing dye profiles (specifically, dyes and dyed cloth purchased from merchants sometimes have incorrect or missing dye information). Until those bugs are fixed, I'm not comfortable with possibly combining bugged and unbugged dye stacks, at least not until the consequences of doing this are known and understood.

Merchant dyes can end up with missing or incorrect dye info due to
unfixed vanilla bugs. Give such items a unique comparison key so they
stay uncombined rather than being merged into an unrelated stack.
@Alistair-Afton

Copy link
Copy Markdown
Author

@ab9rf Good point. Dyes missing their dye_profile now get a unique comparison key each, so they can never be merged into another stack or each other. Unprofiled non-dye powders (flour and such) are unaffected, and properly profiled dyes still combine per profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants