Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: handle "flour" food type preference. #225

Merged
merged 2 commits into from Nov 18, 2020
Merged

FIX: handle "flour" food type preference. #225

merged 2 commits into from Nov 18, 2020

Conversation

acattaneo88
Copy link
Contributor

This small correction fixes a problem when adding flours as a food type preference to a unit.

Relevant forum post:
http://www.bay12forums.com/smf/index.php?topic=110027.msg8205633#msg8205633

Copy link
Member

@lethosor lethosor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Left a comment regarding your FIXME note, but not urgent.

@@ -297,6 +297,7 @@ local preference_functions = {
local item_subtype = -1
local food_mat_index = mat_info.material.food_mat_index
-- FIXME: is fish missing? Apparently it's considered meat...
-- FIXME: maybe automatize this process instead of using a chain of if-elseif statements?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enums defined in DF-structures support attributes, which could allow mapping organic_mat_category items to item_type items, if the mapping defined here is general enough. (If it only makes sense in this script, or if you want to deliberately exclude some entries, defining a table in this script could also make sense.)

Example of attributes: https://github.com/DFHack/df-structures/blob/dd8b9335007941c3aea27474b0a08ba31f6bc97f/df.job-types.xml#L21
organic_mat_category definition: https://github.com/DFHack/df-structures/blob/dd8b9335007941c3aea27474b0a08ba31f6bc97f/df.materials.xml#L454

@lethosor lethosor added this to In progress in 0.47.04-r4 via automation Nov 18, 2020
lethosor added a commit that referenced this pull request Nov 18, 2020
@lethosor lethosor merged commit 9c32027 into DFHack:master Nov 18, 2020
0.47.04-r4 automation moved this from In progress to Done Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.47.04-r4
  
Done
2 participants