Merge pull request #2639 from aws-lumberyard-dev/nvsickle/NetworkingActivationOrder
Ensure network autonomy gets set before entity activation
This commit is contained in:
@@ -309,7 +309,7 @@ namespace Multiplayer
|
||||
}
|
||||
|
||||
INetworkEntityManager::EntityList NetworkEntityManager::CreateEntitiesImmediate(
|
||||
const AzFramework::Spawnable& spawnable, NetEntityRole netEntityRole)
|
||||
const AzFramework::Spawnable& spawnable, NetEntityRole netEntityRole, AutoActivate autoActivate)
|
||||
{
|
||||
INetworkEntityManager::EntityList returnList;
|
||||
|
||||
@@ -359,6 +359,11 @@ namespace Multiplayer
|
||||
const NetEntityId netEntityId = NextId();
|
||||
netBindComponent->PreInit(clone, prefabEntityId, netEntityId, netEntityRole);
|
||||
|
||||
if (autoActivate == AutoActivate::DoNotActivate)
|
||||
{
|
||||
clone->SetRuntimeActiveByDefault(false);
|
||||
}
|
||||
|
||||
AzFramework::GameEntityContextRequestBus::Broadcast(
|
||||
&AzFramework::GameEntityContextRequestBus::Events::AddGameEntity, clone);
|
||||
|
||||
@@ -378,10 +383,11 @@ namespace Multiplayer
|
||||
(
|
||||
const PrefabEntityId& prefabEntryId,
|
||||
NetEntityRole netEntityRole,
|
||||
const AZ::Transform& transform
|
||||
const AZ::Transform& transform,
|
||||
AutoActivate autoActivate
|
||||
)
|
||||
{
|
||||
return CreateEntitiesImmediate(prefabEntryId, NextId(), netEntityRole, AutoActivate::Activate, transform);
|
||||
return CreateEntitiesImmediate(prefabEntryId, NextId(), netEntityRole, autoActivate, transform);
|
||||
}
|
||||
|
||||
INetworkEntityManager::EntityList NetworkEntityManager::CreateEntitiesImmediate
|
||||
@@ -414,7 +420,7 @@ namespace Multiplayer
|
||||
|
||||
if (entityIndex == PrefabEntityId::AllIndices)
|
||||
{
|
||||
return CreateEntitiesImmediate(*netSpawnable, netEntityRole);
|
||||
return CreateEntitiesImmediate(*netSpawnable, netEntityRole, autoActivate);
|
||||
}
|
||||
|
||||
const AzFramework::Spawnable::EntityList& entities = netSpawnable->GetEntities();
|
||||
|
||||
@@ -43,12 +43,13 @@ namespace Multiplayer
|
||||
ConstNetworkEntityHandle GetEntity(NetEntityId netEntityId) const override;
|
||||
NetEntityId GetNetEntityIdById(const AZ::EntityId& entityId) const override;
|
||||
|
||||
EntityList CreateEntitiesImmediate(const AzFramework::Spawnable& spawnable, NetEntityRole netEntityRole);
|
||||
EntityList CreateEntitiesImmediate(const AzFramework::Spawnable& spawnable, NetEntityRole netEntityRole, AutoActivate autoActivate);
|
||||
EntityList CreateEntitiesImmediate
|
||||
(
|
||||
const PrefabEntityId& prefabEntryId,
|
||||
NetEntityRole netEntityRole,
|
||||
const AZ::Transform& transform
|
||||
const AZ::Transform& transform,
|
||||
AutoActivate autoActivate = AutoActivate::Activate
|
||||
) override;
|
||||
EntityList CreateEntitiesImmediate
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user