combine: differentiate dyes by dye_profile instead of excluding them - #1617
Open
Alistair-Afton wants to merge 2 commits into
Open
Alistair-Afton wants to merge 2 commits into
Alistair-Afton wants to merge 2 commits into
Conversation
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
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the blanket exclusion of dye powders from
combine(the previous mitigation for DFHack/dfhack#5849) and instead includes adye_profilefingerprint 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.luais now loadable as a module and exposesunit_test_hooksfor the comparison-key logic. Five new in-engine tests intest/combine.lua; changelog updated.Testing
test/combine.lua: 5/5 tests pass in-gamecombine --dry-runverified against a live fortci/lint.pyclean