From 7d66a29af9811fa60a2edfccc35354b1ee9eed1f Mon Sep 17 00:00:00 2001 From: PreLeyZero Date: Wed, 23 Mar 2022 19:20:53 +0100 Subject: [PATCH] added if condition to prevent crash --- scripts/krastorio2/overhaul.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/krastorio2/overhaul.lua b/scripts/krastorio2/overhaul.lua index e89dc53..4ccadd9 100644 --- a/scripts/krastorio2/overhaul.lua +++ b/scripts/krastorio2/overhaul.lua @@ -169,14 +169,15 @@ function find_following_techs(tech, break_con) for i,v in pairs(data.raw.technology) do --i = techname, v = data.raw.technology[techname] - - for j,w in ipairs(data.raw.technology[i].prerequisites) do - --prerequisites = {'el_energy_tech'} - --j = index, w = techname - - if w == tech then - if not (i == break_con) then - table.insert(return_table, i) + if data.raw.technology[i].prerequisites then + for j,w in ipairs(data.raw.technology[i].prerequisites) do + --prerequisites = {'el_energy_tech'} + --j = index, w = techname + + if w == tech then + if not (i == break_con) then + table.insert(return_table, i) + end end end end