From a3cba03219d74f7e73f9d707a960869525a9e73d Mon Sep 17 00:00:00 2001 From: Luke aka SwissalpS <Luke@SwissalpS.ws> Date: Sat, 27 May 2023 19:48:42 +0200 Subject: [PATCH] apply suggestions Co-authored-by: OgelGames <olliverdc28@gmail.com> --- teleport_tube.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/teleport_tube.lua b/teleport_tube.lua index 52a8a16..e888333 100644 --- a/teleport_tube.lua +++ b/teleport_tube.lua @@ -277,19 +277,16 @@ local function digiline_action(pos, _, digiline_channel, msg) end local channel = meta:get_string("channel") local can_receive = meta:get_int("can_receive") - local t_msg = type(msg) - if t_msg == "string" then + if type(msg) == "string" then channel = msg - elseif t_msg == "table" then + elseif type(msg) == "table" then if type(msg.channel) == "string" then channel = msg.channel end - if nil ~= msg.can_receive then - if msg.can_receive == 1 or msg.can_receive == true then - can_receive = 1 - else - can_receive = 0 - end + if msg.can_receive == 1 or msg.can_receive == true then + can_receive = 1 + elseif msg.can_receive == 0 or msg.can_receive == false then + can_receive = 0 end else return