diff --git a/plugins/research_sync/module/sync.lua b/plugins/research_sync/module/sync.lua index 108e0b2d..e6074d97 100644 --- a/plugins/research_sync/module/sync.lua +++ b/plugins/research_sync/module/sync.lua @@ -141,7 +141,8 @@ function research_sync.sync_technologies(data) for _, tech_data in pairs(game.json_to_table(data)) do local tech = force.technologies[tech_data[nameIndex]] if tech and tech.enabled and tech.level <= tech_data[levelIndex] then - tech.level = tech_data[levelIndex] + tech.level = math.min(tech_data[levelIndex], tech.prototype.max_level) + local progress if tech_data[researchedIndex] then tech.researched = true @@ -188,6 +189,10 @@ function research_sync.research_technology(name, level) return end + if level > tech.prototype.max_level then + level = tech.prototype.max_level + end + global.research_sync.ignore_research_finished = true if tech == force.current_research and tech.level == level then force.research_progress = 1 diff --git a/views/head.ejs b/views/head.ejs index 6f61484b..913629fb 100644 --- a/views/head.ejs +++ b/views/head.ejs @@ -1,5 +1,5 @@