Code refactor

This commit is contained in:
TechnoStrife committed 2019-07-12 18:52:47 +03:00
1 parent 1f8ac50950
commit fa4c10dce2
4 files changed
+86 -61

No files matched your search

+7 -2
View File
@@ -1,9 +1,14 @@
/silent-command
local data = {};
for _, tech in pairs(game.forces["player"].technologies) do
table.insert(data, tech.name .. ":" .. tostring(tech.researched) .. ":" .. tostring(tech.level));
local tech_data = {
tech.name,
tostring(tech.researched),
tostring(tech.level),
}
tech_data = table.concat(tech_data, ':')
table.insert(data, tech_data);
end
game.write_file("researchSync.txt", table.concat(data, "\n"), false, 0)