From 8828183befafdf1bf3a26e3b6303cc824da36b81 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Tue, 12 Mar 2024 14:17:29 +1100 Subject: [PATCH] remove nan values from digiline messages --- tubes/lua.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tubes/lua.lua b/tubes/lua.lua index 1fc9208..7a76fe9 100644 --- a/tubes/lua.lua +++ b/tubes/lua.lua @@ -370,7 +370,10 @@ local function clean_and_weigh_digiline_message(msg, back_references) return msg, #msg + 25 elseif t == "number" then -- Numbers are passed by value so need not be touched, and cost 8 bytes - -- as all numbers in Lua are doubles. + -- as all numbers in Lua are doubles. NaN values are removed. + if msg ~= msg then + return nil, 0 + end return msg, 8 elseif t == "boolean" then -- Booleans are passed by value so need not be touched, and cost 1