From 179f569113705f8bea310f25f54c2a5d0603f9a4 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 12 Nov 2022 06:33:10 -0800 Subject: [PATCH] [ntcore] Notify locally on SetDefault (#4617) This is necessary for the simulation GUI to pick up default publishes. --- ntcore/src/main/native/cpp/LocalStorage.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ntcore/src/main/native/cpp/LocalStorage.cpp b/ntcore/src/main/native/cpp/LocalStorage.cpp index c645e21b7a..2145011492 100644 --- a/ntcore/src/main/native/cpp/LocalStorage.cpp +++ b/ntcore/src/main/native/cpp/LocalStorage.cpp @@ -1234,7 +1234,7 @@ bool LSImpl::SetDefaultEntryValue(NT_Handle pubsubentryHandle, } if (auto topic = GetTopic(pubsubentryHandle)) { if (topic->type == NT_UNASSIGNED || topic->type == value.type()) { - // set without notifying + // force value timestamps to 0 topic->type = value.type(); topic->lastValue = value; topic->lastValue.SetTime(0); @@ -1249,9 +1249,7 @@ bool LSImpl::SetDefaultEntryValue(NT_Handle pubsubentryHandle, return true; } } - if (publisher->active && m_network) { - m_network->SetValue(publisher->handle, value); - } + PublishLocalValue(publisher, topic->lastValue); return true; } }