Skip to content

Shinhan fix 2.1 - #181

Open
Shinhan wants to merge 3 commits into
DanielKote:Mainfrom
Shinhan:shinhan-fix-2.1
Open

Shinhan fix 2.1#181
Shinhan wants to merge 3 commits into
DanielKote:Mainfrom
Shinhan:shinhan-fix-2.1

Conversation

@Shinhan

@Shinhan Shinhan commented Aug 2, 2026

Copy link
Copy Markdown

Implementing support for Factorio 2.1 as suggested in #178

@Olipro
Olipro self-requested a review August 3, 2026 13:14
@Olipro Olipro added the bug Something isn't working label Aug 3, 2026
@Olipro Olipro linked an issue Aug 3, 2026 that may be closed by this pull request

amount = (product.amount == nil) and ((product.amount_max + product.amount_min)/2) or product.amount
amount = amount * ((product.probability == nil) and 1 or product.probability)
amount = amount * (product.independent_probability * (product.shared_probability.max - product.shared_probability.min))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I notice that in https://lua-api.factorio.com/latest/types/ProductPrototypeBase.html#independent_probability that this field is optional just as probability was.

Are you sure that it's not necessary to nil-coalesce the value to 1? I'm concerned that certain items could result in this turning into amount = amount * 0

@Olipro

Olipro commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this. Just one comment to resolve and we can merge it.

If you are willing, I'd appreciate if you did regenerate the Vanilla & Space Age presets that we keep under https://github.com/DanielKote/Foreman2/tree/Main/Foreman/Presets - they're just a copy-paste of the files you generate yourself in Foreman2.

If not, no worries but I'm currently short of time to work on Foreman so if you were able to do it, I'd be able to tag off a new version and have the CI release it.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] import preset from factorio 2.1.7 impossible

2 participants