From ff426412efc7f8e2938eab18275c1a639b1ff51b Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Sun, 7 May 2023 22:13:42 +0100 Subject: [PATCH] Fix sheep wool farm crash --- mods/ITEMS/REDSTONE/mesecons/actionqueue.lua | 2 ++ mods/ITEMS/REDSTONE/mesecons/internal.lua | 1 + 2 files changed, 3 insertions(+) diff --git a/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua b/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua index 489a81b4a..34202aecd 100644 --- a/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua +++ b/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua @@ -89,6 +89,8 @@ minetest.register_globalstep(function (dtime) end) function mesecon.queue:execute(action) + if not action.pos then return end + -- ignore if action queue function name doesn't exist, -- (e.g. in case the action queue savegame was written by an old mesecons version) if mesecon.queue.funcs[action.func] then diff --git a/mods/ITEMS/REDSTONE/mesecons/internal.lua b/mods/ITEMS/REDSTONE/mesecons/internal.lua index dbe3ebe12..06a5d08b9 100644 --- a/mods/ITEMS/REDSTONE/mesecons/internal.lua +++ b/mods/ITEMS/REDSTONE/mesecons/internal.lua @@ -521,6 +521,7 @@ end -- outputnode (receptor or conductor) at position `output` and has an output in direction `rule` function mesecon.rules_link_rule_all(output, rule) local input = vector.add(output, rule) + if not input then return {} end local inputnode = get_node_force(input) local inputrules = mesecon.get_any_inputrules(inputnode) if not inputrules then