Refactor Selection Util (#409)

* Add Selection to ExpUtil

* Convert modules to use new lib

* Bug Fixes
This commit is contained in:
Cooldude2606
2025-09-04 10:54:55 +01:00
committed by GitHub
parent 85c7cce740
commit 27a2feaae9
9 changed files with 316 additions and 263 deletions

View File

@@ -301,8 +301,9 @@ end
--- @param force LuaForce
--- @return number
function Elements.container.calculate_starting_research_index(force)
local force_data = Elements.container.data[force]
local force_data = Elements.container.data[force] or {}
local research_index = research_targets.length
Elements.container.data[force] = force_data -- needed because of @clusterio/research_sync
-- # does not work here because it returned the array alloc size
for i = 1, research_targets.length do