Skip to content
Snippets Groups Projects
Commit 00083460 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

fix(cave): Fixes player type issue in player spawning and DCRA attachment...

fix(cave): Fixes player type issue in player spawning and DCRA attachment process for standalone Cave
parent 5794597a
No related branches found
No related tags found
2 merge requests!107UE5.4-2024.1-rc1,!98Improved join/attachment logic for clusters to support multi-cluster connections at some point
Pipeline #444791 passed
...@@ -53,6 +53,9 @@ FString ARWTHVRGameModeBase::InitNewPlayer(APlayerController* NewPlayerControlle ...@@ -53,6 +53,9 @@ FString ARWTHVRGameModeBase::InitNewPlayer(APlayerController* NewPlayerControlle
else if (GetNetMode() == NM_Standalone && URWTHVRUtilities::IsRoomMountedMode()) else if (GetNetMode() == NM_Standalone && URWTHVRUtilities::IsRoomMountedMode())
{ {
ClusterId = 0; ClusterId = 0;
const EPlayerType Type =
URWTHVRUtilities::IsPrimaryNode() ? EPlayerType::nDisplayPrimary : EPlayerType::nDisplaySecondary;
State->RequestSetPlayerType(Type);
} }
State->SetCorrespondingClusterId(ClusterId); State->SetCorrespondingClusterId(ClusterId);
} }
...@@ -112,10 +115,11 @@ void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer) ...@@ -112,10 +115,11 @@ void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer)
return; return;
} }
// When we're not in standalone:
// If the new player is a secondary nDisplay node, spawn it only as a Spectator // If the new player is a secondary nDisplay node, spawn it only as a Spectator
// Potentially we can use MustSpectate instead. // Potentially we can use MustSpectate instead.
UClass* PawnClass; UClass* PawnClass;
if (State->GetPlayerType() == EPlayerType::nDisplaySecondary) if (GetNetMode() != NM_Standalone && State->GetPlayerType() == EPlayerType::nDisplaySecondary)
{ {
// For now, simply use the BP approach of spawning the pawn here. Can do this in a better way potentially. // For now, simply use the BP approach of spawning the pawn here. Can do this in a better way potentially.
PawnClass = SpectatorClass; PawnClass = SpectatorClass;
......
...@@ -128,7 +128,7 @@ bool AClusterRepresentationActor::AttachDCRA() ...@@ -128,7 +128,7 @@ bool AClusterRepresentationActor::AttachDCRA()
} }
bool bAttached = DCRA->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale); bool bAttached = DCRA->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
UE_LOGFMT(Toolkit, Display, "Attaching DCRA {DCRA} to {this} returned {Res}", GetName(), DCRA->GetName(), UE_LOGFMT(Toolkit, Display, "Attaching DCRA {DCRA} to {this} returned {Res}", DCRA->GetName(), GetName(),
bAttached); bAttached);
DCRA->SetActorEnableCollision(false); DCRA->SetActorEnableCollision(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment