Remove NaN values (#667)

NaN can cause problems (and errors) if the receiving node doesn't check for it, this PR makes it so NaN values are removed from digiline messages.
此提交包含在:
OgelGames
2024-03-15 05:54:19 +11:00
提交者 GitHub
父節點 59780437f2
當前提交 cffbc33e6d

查看文件

@@ -388,7 +388,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