Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Game/Content/Characters/BP_SimulatedPlayerCharacter.uasset
Binary file not shown.
5 changes: 5 additions & 0 deletions Game/Source/GDKShooter/Private/Characters/GDKCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,8 @@ bool AGDKCharacter::CanBeSeenFrom(const FVector& ObserverLocation, FVector& OutS
OutSightStrength = (float)PositiveHits / (float)NumberOfLoSChecksPerformed;
return PositiveHits > 0;
}

void AGDKCharacter::ClientMovementReset_Implementation()
{
GetCharacterMovement()->ResetPredictionData_Server();
}
7 changes: 7 additions & 0 deletions Game/Source/GDKShooter/Public/Characters/GDKCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ class GDKSHOOTER_API AGDKCharacter : public ACharacter, public IGenericTeamAgent
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
void StartRagdoll();

// ----- HACKY WORKAROUND, KEEP AWAY FROM PRODUCTION CODE ----
// This class is used by simplayer, which locally replaces the Pawn's controller without the server's knowledge
// Unpossessing a character resets its movement data, so this is used to inform the server that it happened.
// Getting rid of this hack means adding AIController-like capabilities to the regular PlayerController.
UFUNCTION(BlueprintCallable, Server, Unreliable)
void ClientMovementReset();

private:
UFUNCTION()
void DeleteSelf();
Expand Down