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

Forgot to think about at least one edge case for player types. Needs to be...

Forgot to think about at least one edge case for player types. Needs to be tested but has no relevancy for now anyway.
parent bc0642e9
No related branches found
No related tags found
1 merge request!31Initial Pawn Replication
......@@ -75,24 +75,30 @@ void AVirtualRealityPawn::SetupPlayerInputComponent(UInputComponent* PlayerInput
return;
}
EPlayerType Type = EPlayerType::Desktop;
if (UVirtualRealityUtilities::IsDesktopMode())
{
PlayerController->bShowMouseCursor = true;
PlayerController->bEnableClickEvents = true;
PlayerController->bEnableMouseOverEvents = true;
}
else if (UVirtualRealityUtilities::IsHeadMountedMode())
{
Type = EPlayerType::HMD;
}
ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>();
// Should not do this here but on connection or on possess I think.
ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>();
if (State)
{
// Might not be properly synced yet?
const EPlayerType Type = State->GetPlayerType();
// Don't do anything with the type if it's been set to clustertype or anything.
const bool bClusterType = Type == EPlayerType::nDisplayPrimary || Type == EPlayerType::nDisplaySecondary;
if (!bClusterType && UVirtualRealityUtilities::IsHeadMountedMode())
{
// Could be too early to call this RPC...
State->RequestSetPlayerType(Type);
}
}
if (UVirtualRealityUtilities::IsDesktopMode())
{
PlayerController->bShowMouseCursor = true;
PlayerController->bEnableClickEvents = true;
PlayerController->bEnableMouseOverEvents = true;
}
InputSubsystem->ClearAllMappings();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment