From bd8c2c19c03012804fe3ca65f97cea2ac3e345c0 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sun, 13 Apr 2025 00:13:17 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/gui/research.lua | 2 +- exp_scenario/module/commands/research.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exp_legacy/module/modules/gui/research.lua b/exp_legacy/module/modules/gui/research.lua index accff062..ed6925fa 100644 --- a/exp_legacy/module/modules/gui/research.lua +++ b/exp_legacy/module/modules/gui/research.lua @@ -144,7 +144,7 @@ local function research_gui_update() else data.attempt = research_time_format(research.time[res_i]) - local diff = (research.time[res_i] or 0) - (entry.target or 0) + local diff = research.time[res_i] - (entry.target or 0) data.difference = (diff < 0 and "-" or "") .. research_time_format(math.abs(diff)) data.color = (diff < 0 and font_color["positive"]) or font_color["negative"] end diff --git a/exp_scenario/module/commands/research.lua b/exp_scenario/module/commands/research.lua index cef23671..d56b1ada 100644 --- a/exp_scenario/module/commands/research.lua +++ b/exp_scenario/module/commands/research.lua @@ -71,7 +71,7 @@ local function on_research_finished(event) if not research.res_queue_enable then return end local force = event.research.force - if config.bonus_inventory.res[config.mod_set] and force.technologies[config.bonus_inventory.res[config.mod_set].name].level > config.bonus_inventory.res[config.mod_set].level then + if config.bonus_inventory.res[config.mod_set] and force.technologies[config.bonus_inventory.res[config.mod_set].name] and force.technologies[config.bonus_inventory.res[config.mod_set].name].level > config.bonus_inventory.res[config.mod_set].level then module.res_queue(force, event.by_script) end end