From 683b61a6406d67ebe2b6ff4050302325cef48d50 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Fri, 7 May 2021 16:05:18 -0500 Subject: [PATCH] Added check for already deserialized messages. --- minehost.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/minehost.lua b/minehost.lua index 704cdfa..297e12b 100644 --- a/minehost.lua +++ b/minehost.lua @@ -118,7 +118,11 @@ local function listenToMiners() while running do local event, side, sendChannel, replyChannel, serialized, distance = os.pullEvent("modem_message") print("") - local data = textutils.unserialise(serialized) + local data = nil + if not pcall(function() data = textutils.unserialise(serialized) end) then + print("Message already table, not deserializing.") + data = serialized + end if data["token"] == TOKEN and data["recipient"] == HOST then handleMessage(data["sender"], data["type"], data) else