Add asserts to auto research queue (#385)

* Update research.lua

* Use asserts rather than ignore errors

---------

Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com>
This commit is contained in:
2025-04-17 04:29:35 +09:00
committed by GitHub
parent aedc3cff6b
commit 64b9d0db40

View File

@@ -71,7 +71,9 @@ local function on_research_finished(event)
if not research.res_queue_enable then return end
local force = event.research.force
if force.technologies[config.bonus_inventory.res[config.mod_set].name].level > config.bonus_inventory.res[config.mod_set].level then
local research = assert(config.bonus_inventory.res[config.mod_set], "Unknown mod set: " .. tostring(config.mod_set))
local technology = assert(force.technologies[research.name], "Unknown technology: " .. tostring(research.name))
if technology.level > research.level then
module.res_queue(force, event.by_script)
end
end