From 421d32dea7f8655355131b14b455c0b82cc232a7 Mon Sep 17 00:00:00 2001 From: Someone Date: Wed, 23 Oct 2024 15:40:37 +0200 Subject: [PATCH] RELEASE 2.0.3 - Should no longer not research anything if there is an event triggerable reserch available --- changelog.txt | 7 +++++++ control.lua | 15 +++++++++++---- info.json | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/changelog.txt b/changelog.txt index fd14a8c..15de050 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 2.0.3 +Date: 2024-10-23 + + Changed: + - Should no longer not research anything if there is an event triggerable reserch available. + --------------------------------------------------------------------------------------------------- Version: 2.0.2 Date: 2024-10-23 diff --git a/control.lua b/control.lua index f0080bb..6a95aee 100644 --- a/control.lua +++ b/control.lua @@ -135,6 +135,9 @@ function canResearch(force, tech, config) return false end end + if #tech.research_unit_ingredients == 0 then + return false + end for _, ingredient in pairs(tech.research_unit_ingredients) do if not config.allowed_ingredients[ingredient.name] then return false @@ -221,10 +224,14 @@ function startNextResearch(force, override_spam_detection) table.insert(rq, next_research) for i=1,6 do - if force.research_queue[i] == nil then break end - if not (force.current_research and config.allow_switching and i == 1) then - table.insert(rq, force.research_queue[i].name) - end + if force.research_queue[i] == nil then break end + if i == 1 then + if not (force.current_research and config.allow_switching) then + table.insert(rq, force.research_queue[i].name) + end + else + table.insert(rq, force.research_queue[i].name) + end end force.research_queue = rq diff --git a/info.json b/info.json index d8eae35..8a212e8 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "some-autoresearch", - "version": "2.0.2", + "version": "2.0.3", "title": "Auto Research (fixed + re-published)", "author": "Someone (originally canidae)", "homepage": "https://git.somenet.org/factorio/some-autoresearch.git", -- 2.43.0