From 10fb2a9162cf766d7a7f8471af1b9a45efcd781d Mon Sep 17 00:00:00 2001 From: notnotmelon Date: Thu, 10 Aug 2023 00:25:45 -0500 Subject: [PATCH] fix crash with farm buildings & deconstruction planner --- changelog.txt | 1 + scripts/farming/farming.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index b4845a8b..e0061fe5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -6,6 +6,7 @@ Date: ? - fixed that whenever your ulric transformation expired it would reset all connected caravan schedules - added fallback icon sprites for vessel to ground - removed caravan map tags. this results in a 15x UPS improvement. for some reason that API call is extremely laggy + - fix crash with farm buildings & deconstruction planner TURD: - auog path 2 is now unethical - fish path 2 now can improve your hydrolysate production diff --git a/scripts/farming/farming.lua b/scripts/farming/farming.lua index 23cba969..65917b50 100644 --- a/scripts/farming/farming.lua +++ b/scripts/farming/farming.lua @@ -84,7 +84,8 @@ Farming.events[121] = function() local first_index_checked_this_tick = global.next_farm_index for i = 1, 60 do local farm = global.enabled_farm_buildings[global.next_farm_index] - if not farm.valid then + + if not farm or not farm.valid then table.remove(global.enabled_farm_buildings, global.next_farm_index) elseif farm.get_module_inventory().is_empty() then Farming.disable_machine(farm)