Shinhan fix 2.1 - #181
Conversation
|
|
||
| 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)) |
There was a problem hiding this comment.
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
|
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. |
Implementing support for Factorio 2.1 as suggested in #178