[0.18.47] [Lua] on_research_finished gives incorrect research
Posted: Tue Aug 11, 2020 9:19 pm
When having an research that has multiple levels (e.g. infinite research) the on_research_finished gives off the wrong level.
I have not tested it with lower levels (e.g. mining-productivity-[1-3]). but with infinite research levels this is certainly the case.
Setup:
factorio default settings
in the mod:
- using the event_handler.lua from core
- use a lib {events = {[defines.events.on_research_complete] => function() end} }
- In this
The added screenshot should show exactly the issue. Since i would assume that it would show the actual researched tech.
It also has the researched: false.
So it seems to me it points to the incorrect tech (aka the next in the list, instead of the actual researched one)
You get the same value/tech in the game.forces.player.previous_research in that event.
I would expect that it would show the correct level that has been researched, not the one that can be researched.
(minimized control.lua attached)
I have not tested it with lower levels (e.g. mining-productivity-[1-3]). but with infinite research levels this is certainly the case.
Setup:
factorio default settings
in the mod:
- using the event_handler.lua from core
- use a lib {events = {[defines.events.on_research_complete] => function() end} }
- In this
The added screenshot should show exactly the issue. Since i would assume that it would show the actual researched tech.
It also has the researched: false.
So it seems to me it points to the incorrect tech (aka the next in the list, instead of the actual researched one)
You get the same value/tech in the game.forces.player.previous_research in that event.
I would expect that it would show the correct level that has been researched, not the one that can be researched.
(minimized control.lua attached)