mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
Simplify level logic
Simplify tech level logic according to TheAiBot's suggestion.
This commit is contained in:
1 parent
e9fab3cc10
commit
f3c13eab21
1 file changed
+1
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user