From be6415c470307ab27ee27e9504821a7dc69355f6 Mon Sep 17 00:00:00 2001 From: Valentyn Nykoliuk Date: Thu, 18 Jul 2019 16:44:31 +0100 Subject: [PATCH] Skip actor itself when iterating ReplicationMap when creating entity --- .../Source/SpatialGDK/Private/Interop/SpatialSender.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SpatialGDK/Source/SpatialGDK/Private/Interop/SpatialSender.cpp b/SpatialGDK/Source/SpatialGDK/Private/Interop/SpatialSender.cpp index e707846dc4..8a4d13cf7c 100644 --- a/SpatialGDK/Source/SpatialGDK/Private/Interop/SpatialSender.cpp +++ b/SpatialGDK/Source/SpatialGDK/Private/Interop/SpatialSender.cpp @@ -262,6 +262,12 @@ Worker_RequestId USpatialSender::CreateEntity(USpatialActorChannel* Channel) if (UObject* Subobject = RepSubobject.Value()->GetWeakObjectPtr().Get()) #endif { + if (Subobject == Actor) + { + // Actor's replicator is also contained in ReplicationMap. + continue; + } + // If this object is not in the PackageMap, it has been dynamically created. if (!PackageMap->GetUnrealObjectRefFromObject(Subobject).IsValid()) {