From 960b2e5b4549ccfe69e99c23bc098470d3ae07eb Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Thu, 28 Mar 2024 07:13:32 +0100 Subject: [PATCH] Don't try to check if other reactor chambers are powered if Nuclear Reactor wasn't initialized Fixes #7 --- compat/mesecons.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compat/mesecons.lua b/compat/mesecons.lua index b8a6d96..01d4105 100644 --- a/compat/mesecons.lua +++ b/compat/mesecons.lua @@ -93,11 +93,13 @@ override={ if meta:get_int("meseconPowered")==1 then return end - local chambers=minetest.deserialize(meta:get_string("chambers")) - for _,chamber in ipairs(chambers) do - local chamberMeta=minetest.get_meta(chamber) - if chamberMeta:get_int("meseconPowered")==1 then - return + if meta:contains("chambers") then + local chambers=minetest.deserialize(meta:get_string("chambers")) + for _,chamber in ipairs(chambers) do + local chamberMeta=minetest.get_meta(chamber) + if chamberMeta:get_int("meseconPowered")==1 then + return + end end end