RELEASE 2.0.3 - Should no longer not research anything if there is an event triggerab...
authorSomeone <someone@somenet.org>
Wed, 23 Oct 2024 13:40:37 +0000 (15:40 +0200)
committerSomeone <someone@somenet.org>
Wed, 23 Oct 2024 13:40:37 +0000 (15:40 +0200)
changelog.txt
control.lua
info.json

index fd14a8c5ab8a307089b0540d03453db9727961cb..15de050107f1c4992f3597f9b83169539ac0f131 100644 (file)
@@ -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
index f0080bbb1967e9e74365fe52405787862c4605c6..6a95aeea8642c403877462dcd962235a2a3cf411 100644 (file)
@@ -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
index d8eae356ba84be53bbf0b3dbda88ba18bef46a1e..8a212e807c123124c06a27be9f1b9afaf038a41a 100644 (file)
--- 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",