From 186ccd92e5cdcbe96cea727368d56e0f8624a233 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Wed, 29 May 2024 12:18:11 +0200 Subject: [PATCH] Publish model when networkid was received --- NetworkSync.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NetworkSync.cpp b/NetworkSync.cpp index 1c35879..abd2014 100644 --- a/NetworkSync.cpp +++ b/NetworkSync.cpp @@ -28,8 +28,9 @@ void NetworkSync::ReceiveMessage(Roboid *roboid, unsigned char bytecount) { void NetworkSync::ReceiveNetworkId() { this->networkId = buffer[1]; #ifdef RC_DEBUG - printf("Received network Id %d\n", this->networkId); + printf("_Received network Id %d\n", this->networkId); #endif + PublishModel(roboid); } void NetworkSync::NewObject(InterestingThing *thing) { @@ -50,6 +51,9 @@ void NetworkSync::NewObject(InterestingThing *thing) { } void NetworkSync::PublishModel(Roboid *roboid) { + if (roboid->modelUrl == nullptr) + return; + int len = strlen(roboid->modelUrl); if (len > 255) return;