LuaItemPrototype::get_module_effects(quality?)

SWeini
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Mon Apr 04, 2022 6:43 am
Contact:

LuaItemPrototype::get_module_effects(quality?)

Post by SWeini »

There is LuaItemPrototype::module_effects, but it is very difficult to properly calculate the effects of a module with given quality due to integer math and rounding going on. This problem got more serious with the addition of QualityPrototype::default_modifier. It's very difficult to reproduce the rounding behavior in Lua.

I'd like to see a method LuaItemPrototype::get_module_effects(quality?) that returns module_effects multiplied by the quality multiplier, with proper rounding.
Bilka
Factorio Staff
Factorio Staff
Posts: 3569
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaItemPrototype::get_module_effects(quality?)

Post by Bilka »

Okay, added for 2.0.67.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Implemented mod requests”