summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2022-01-01 20:22:59 -0600
committercheapie <no-email-for-you@example.com>2022-01-01 20:22:59 -0600
commit59e6f5446152a1e254af549ea8a8b260dce230ba (patch)
tree0f15b2e2d153cbab2b78dc4ee15a1e7bbf4de86b
parentb32480b188cfbded1eacbd0bd875125b6b1f37c3 (diff)
downloadmesecons-59e6f5446152a1e254af549ea8a8b260dce230ba.tar
mesecons-59e6f5446152a1e254af549ea8a8b260dce230ba.tar.gz
mesecons-59e6f5446152a1e254af549ea8a8b260dce230ba.tar.bz2
mesecons-59e6f5446152a1e254af549ea8a8b260dce230ba.tar.xz
mesecons-59e6f5446152a1e254af549ea8a8b260dce230ba.zip
Fix crash when removing a Luacontroller with actions pending
Fixes upstream #566
-rw-r--r--mesecons_luacontroller/init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index 3abe6ed..a689650 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -701,6 +701,9 @@ end
-- Wraps run_inner with LC-reset-on-error
local function run(pos, event)
+ if not (minetest.get_item_group(minetest.get_node(pos).name,"mesecons_luacontroller") > 0) then
+ return false,"Luacontroller no longer exists"
+ end
local meta = minetest.get_meta(pos)
local code = meta:get_string("code")
local ok, errmsg = run_inner(pos, code, event)
@@ -824,9 +827,9 @@ for d = 0, 1 do
local groups
if a + b + c + d ~= 0 then
- groups = {dig_immediate=2, not_in_creative_inventory=1, overheat = 1}
+ groups = {dig_immediate=2, not_in_creative_inventory=1, overheat = 1, mesecons_luacontroller = 1,}
else
- groups = {dig_immediate=2, overheat = 1}
+ groups = {dig_immediate=2, overheat = 1, mesecons_luacontroller = 1,}
end
output_rules[cid] = {}