From 446333f4aab4b4b223810213f5f30f126e11963a Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 24 Apr 2020 15:26:52 +0200 Subject: [PATCH 1/3] Fix stylesheet loaded from wrong location Fix stylesheet path not taking into account the web_root config. --- views/head.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ Clusterio - + From e9fab3cc103dd8958424f0cf89d74761e83976de Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 24 Apr 2020 15:27:30 +0200 Subject: [PATCH 2/3] Fix level > max_level crash in research_sync Fix crash when technologiy level stored on the master is greater than the max_level for the technology in Factorio. This can happen with mods that for example reduce the max_level from inifity to a finite level. --- plugins/research_sync/module/sync.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/research_sync/module/sync.lua b/plugins/research_sync/module/sync.lua index 108e0b2d..75829b7a 100644 --- a/plugins/research_sync/module/sync.lua +++ b/plugins/research_sync/module/sync.lua @@ -141,6 +141,10 @@ 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 + if tech_data[levelIndex] > tech.prototype.max_level then + tech_data[levelIndex] = tech.prototype.max_level + end + tech.level = tech_data[levelIndex] local progress if tech_data[researchedIndex] then @@ -188,6 +192,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 From f3c13eab21d22ed7c01f933c4bea5cf33a0f226b Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 6 May 2020 19:49:33 +0200 Subject: [PATCH 3/3] Simplify level logic Simplify tech level logic according to TheAiBot's suggestion. --- plugins/research_sync/module/sync.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/research_sync/module/sync.lua b/plugins/research_sync/module/sync.lua index 75829b7a..e6074d97 100644 --- a/plugins/research_sync/module/sync.lua +++ b/plugins/research_sync/module/sync.lua @@ -141,11 +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 - if tech_data[levelIndex] > tech.prototype.max_level then - tech_data[levelIndex] = tech.prototype.max_level - end + tech.level = math.min(tech_data[levelIndex], tech.prototype.max_level) - tech.level = tech_data[levelIndex] local progress if tech_data[researchedIndex] then tech.researched = true