@@ -1094,7 +1094,8 @@ void UPBPlayerMovement::CalcVelocity(float DeltaTime, float Friction, bool bFlui
1094
1094
1095
1095
// Do not update velocity when using root motion or when SimulatedProxy -
1096
1096
// SimulatedProxy are repped their Velocity
1097
- if (!HasValidData () || HasAnimRootMotion () || DeltaTime < MIN_TICK_TIME || (CharacterOwner && CharacterOwner->Role == ROLE_SimulatedProxy))
1097
+ if (!HasValidData () || HasAnimRootMotion () || DeltaTime < MIN_TICK_TIME ||
1098
+ (CharacterOwner && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy && !bWasSimulatingRootMotion))
1098
1099
{
1099
1100
return ;
1100
1101
}
@@ -1278,7 +1279,7 @@ void UPBPlayerMovement::DoCrouchResize(float TargetTime, float DeltaTime, bool b
1278
1279
1279
1280
auto DefaultCharacter = CharacterOwner->GetClass ()->GetDefaultObject <ACharacter>();
1280
1281
1281
- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1282
+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
1282
1283
{
1283
1284
// restore collision size before crouching
1284
1285
CharacterCapsule->SetCapsuleSize (DefaultCharacter->GetCapsuleComponent ()->GetUnscaledCapsuleRadius (),
@@ -1336,7 +1337,7 @@ void UPBPlayerMovement::DoCrouchResize(float TargetTime, float DeltaTime, bool b
1336
1337
CharacterOwner->OnStartCrouch (HalfHeightAdjust, ScaledHalfHeightAdjust);
1337
1338
1338
1339
// Don't smooth this change in mesh position
1339
- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1340
+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
1340
1341
{
1341
1342
FNetworkPredictionData_Client_Character* ClientData = GetPredictionData_Client_Character ();
1342
1343
if (ClientData && !FMath::IsNearlyZero (ClientData->MeshTranslationOffset .Z ))
@@ -1525,7 +1526,7 @@ void UPBPlayerMovement::DoUnCrouchResize(float TargetTime, float DeltaTime, bool
1525
1526
CharacterOwner->OnEndCrouch (HalfHeightAdjust, ScaledHalfHeightAdjust);
1526
1527
1527
1528
// Don't smooth this change in mesh position
1528
- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1529
+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
1529
1530
{
1530
1531
FNetworkPredictionData_Client_Character* ClientData = GetPredictionData_Client_Character ();
1531
1532
if (ClientData && !FMath::IsNearlyZero (ClientData->MeshTranslationOffset .Z ))
0 commit comments