Make researchSync work for any research on any node

This commit is contained in:
TechnoStrife committed 2019-07-15 00:46:21 +03:00
1 parent fa4c10dce2
commit 98c6795f8f
4 files changed
+208 -94

No files matched your search

+9 -1
View File
@@ -1,11 +1,19 @@
local data = {};
local force = game.forces["player"];
for _, tech in pairs(game.forces["player"].technologies) do
for _, tech in pairs(force.technologies) do
local progress;
if tech == force.current_research then
progress = force.research_progress
else
progress = force.get_saved_technology_progress(tech.name);
end
local tech_data = {
tech.name,
tostring(tech.researched),
tostring(tech.level),
tostring(progress),
}
tech_data = table.concat(tech_data, ':')
table.insert(data, tech_data);