From ad783d8a7e5361642406d3bcd51ce1b0accd78a9 Mon Sep 17 00:00:00 2001 From: NullBite Date: Sun, 25 Jun 2023 00:46:22 -0400 Subject: [PATCH] sharedstate: don't send unchanged values --- sharedstate.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sharedstate.lua b/sharedstate.lua index b2fd1aa..3243680 100644 --- a/sharedstate.lua +++ b/sharedstate.lua @@ -183,8 +183,11 @@ function sharedstate.set(key, value) local errormsg="sharedstate: Key " .. key .. " has not been initialized." error(errormsg) end - pings.sharedstate_recv(resolve_index(key), value) - -- pings.sharedstate_recv_named(key, value) + -- don't bother sending unchanged values + if value ~= get_value(key) then + -- pings.sharedstate_recv(resolve_index(key), value) + pings.sharedstate_recv_named(key, value) + end end ---Queue entries for sending