Owning connection id will happen on clients as well.

Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com>
This commit is contained in:
AMZN-Olex
2021-10-21 15:14:00 -04:00
parent 37873f81cf
commit 317bb7aa67
@@ -333,8 +333,9 @@ namespace Multiplayer
const NetEntityId netRootId = GetNetworkEntityManager()->GetNetEntityIdById(m_rootEntity->GetId());
controller->SetHierarchyRoot(netRootId);
GetNetBindComponent()->SetOwningConnectionId(m_rootEntity->FindComponent<NetBindComponent>()->GetOwningConnectionId());
}
GetNetBindComponent()->SetOwningConnectionId(m_rootEntity->FindComponent<NetBindComponent>()->GetOwningConnectionId());
}
else
{
@@ -347,9 +348,10 @@ namespace Multiplayer
NetworkHierarchyChildComponentController* controller = static_cast<NetworkHierarchyChildComponentController*>(GetController());
controller->SetHierarchyRoot(InvalidNetEntityId);
GetNetBindComponent()->SetOwningConnectionId(m_previousOwningConnectionId);
}
GetNetBindComponent()->SetOwningConnectionId(m_previousOwningConnectionId);
// We lost the parent hierarchical entity, so as a root we need to re-build our own hierarchy.
RebuildHierarchy();
}