150 CharMovement->UpdatedComponent->SetWorldLocationAndRotation(OldStartLocation, OldMove->StartRotation,
false,
nullptr, CharMovement->GetTeleportType());
151 CharMovement->Velocity = OldMove->StartVelocity;
153 CharMovement->SetBase(OldMove->StartBase.Get(), OldMove->StartBoneName);
154 CharMovement->CurrentFloor = OldMove->StartFloor;
160 DeltaTime += OldMove->DeltaTime;
165 if (BaseSavedMovePending)
173 InCharacter->JumpForceTimeRemaining = OldMove->JumpForceTimeRemaining;
174 InCharacter->JumpKeyHoldTime = OldMove->JumpKeyHoldTime;
319 NetworkMoveType = MoveType;
321 bool bLocalSuccess =
true;
322 const bool bIsSaving = Ar.IsSaving();
328 bool bRepAccel = bIsSaving ? !Acceleration.IsNearlyZero() :
false;
329 Ar.SerializeBits(&bRepAccel, 1);
333 Acceleration.NetSerialize(Ar, PackageMap, bLocalSuccess);
339 Acceleration = FVector::ZeroVector;
345 uint16 Yaw = bIsSaving ? FRotator::CompressAxisToShort(ControlRotation.Yaw) : 0;
346 uint16 Pitch = bIsSaving ? FRotator::CompressAxisToShort(ControlRotation.Pitch) : 0;
347 uint16 Roll = bIsSaving ? FRotator::CompressAxisToShort(ControlRotation.Roll) : 0;
348 bool bRepYaw = Yaw != 0;
350 ACharacter* CharacterOwner = CharacterMovement.GetCharacterOwner();
352 bool bCanRepRollAndPitch = (CharacterOwner && (CharacterOwner->bUseControllerRotationRoll || CharacterOwner->bUseControllerRotationPitch));
353 bool bRepRollAndPitch = bCanRepRollAndPitch && (Roll != 0 || Pitch != 0);
354 Ar.SerializeBits(&bRepRollAndPitch, 1);
356 if (bRepRollAndPitch)
359 uint32 Rotation32 = 0;
360 uint32 Yaw32 = bIsSaving ? Yaw : 0;
364 Rotation32 = (((uint32)Roll) << 16) | ((uint32)Pitch);
365 Ar.SerializeIntPacked(Rotation32);
369 Ar.SerializeIntPacked(Rotation32);
372 Pitch = (Rotation32 & 65535);
373 Roll = (Rotation32 >> 16);
377 uint32 Yaw32 = bIsSaving ? Yaw : 0;
379 Ar.SerializeBits(&bRepYaw, 1);
382 Ar.SerializeIntPacked(Yaw32);
388 ControlRotation.Yaw = bRepYaw ? FRotator::DecompressAxisFromShort(Yaw) : 0;
389 ControlRotation.Pitch = bRepRollAndPitch ? FRotator::DecompressAxisFromShort(Pitch) : 0;
390 ControlRotation.Roll = bRepRollAndPitch ? FRotator::DecompressAxisFromShort(Roll) : 0;
396 SerializeOptionalValue<uint8>(bIsSaving, Ar, CompressedMoveFlags, 0);
397 SerializeOptionalValue<uint8>(bIsSaving, Ar, MovementMode, MOVE_Walking);
401 if (MoveType == ENetworkMoveType::NewMove)
403 Location.NetSerialize(Ar, PackageMap, bLocalSuccess);
406 SerializeOptionalValue<UPrimitiveComponent*>(bIsSaving, Ar, MovementBase,
nullptr);
407 SerializeOptionalValue<FName>(bIsSaving, Ar, MovementBaseBoneName, NAME_None);
412 Ar.SerializeBits(&bHasReplicatedMovementMode, 1);
414 if (bHasReplicatedMovementMode)
428 LFDiff.NetSerialize(Ar, PackageMap, bLocalSuccess);
431 return !Ar.IsError();