From 4cb999beebf87afe50a59b0bf84d5e8347dabdbc Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Thu, 26 Nov 2026 21:44:48 +0300 Subject: [PATCH 1/3] Make FPGA have propper error message on decompress failure So that the player knows why their chip isn't loading --- lua/wire/stools/fpga.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/wire/stools/fpga.lua b/lua/wire/stools/fpga.lua index dac20282e9..a1f65c78b2 100644 --- a/lua/wire/stools/fpga.lua +++ b/lua/wire/stools/fpga.lua @@ -190,13 +190,16 @@ if SERVER then return end - local dataLength = net.ReadUInt(16) - local data = net.ReadData(dataLength) + local data = net.ReadData(net.ReadUInt(16)) + local ok, data = pcall(util.Decompress, data, 1048576) - local ok, data = pcall(util.Decompress, data) - if not ok then return end + if ok then + ok, data = pcall(WireLib.von.deserialize, data) + else + -- To have propper fail reason + data = "Failed to decompress data" + end - ok, data = pcall(WireLib.von.deserialize, data) if ok then chip:Upload(data) else From 5b53f902ff459a48cc84174b0b95fde229be4155 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:59:21 +0300 Subject: [PATCH 2/3] No reason to pcall this --- lua/wire/stools/fpga.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/wire/stools/fpga.lua b/lua/wire/stools/fpga.lua index a1f65c78b2..23ade21b80 100644 --- a/lua/wire/stools/fpga.lua +++ b/lua/wire/stools/fpga.lua @@ -190,14 +190,15 @@ if SERVER then return end + local ok local data = net.ReadData(net.ReadUInt(16)) - local ok, data = pcall(util.Decompress, data, 1048576) + data = util.Decompress(data, 1048576) - if ok then + if data then ok, data = pcall(WireLib.von.deserialize, data) else -- To have propper fail reason - data = "Failed to decompress data" + ok, data = false "Failed to decompress data" end if ok then @@ -370,4 +371,4 @@ if CLIENT then end end -end \ No newline at end of file +end From 259bb0d0436c1143884fd33ee2523c31a2fa2db3 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Fri, 27 Nov 2026 01:06:35 +0300 Subject: [PATCH 3/3] Woops --- lua/wire/stools/fpga.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wire/stools/fpga.lua b/lua/wire/stools/fpga.lua index 23ade21b80..0919e9e400 100644 --- a/lua/wire/stools/fpga.lua +++ b/lua/wire/stools/fpga.lua @@ -198,7 +198,7 @@ if SERVER then ok, data = pcall(WireLib.von.deserialize, data) else -- To have propper fail reason - ok, data = false "Failed to decompress data" + ok, data = false, "Failed to decompress data" end if ok then