void AShooterWeapon_Instant::ProcessInstantHit(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir, int32 RandomSeed, float ReticleSpread) { if (MyPawn && MyPawn->IsLocallyControlled() && GetNetMode() == NM_Client) { // if we're a client and we've hit something that is being controlled by the server if (Impact.GetActor() && Impact.GetActor()->GetRemoteRole() == ROLE_Authority) { // notify the server of the hit ServerNotifyHit(Impact, ShootDir, RandomSeed, ReticleSpread); } else if (Impact.GetActor() == NULL) { if (Impact.bBlockingHit) { // notify the server of the hit ServerNotifyHit(Impact, ShootDir, RandomSeed, ReticleSpread); } else { // notify server of the miss ServerNotifyMiss(ShootDir, RandomSeed, ReticleSpread); } } } // process a confirmed hit ProcessInstantHit_Confirmed(Impact, Origin, ShootDir, RandomSeed, ReticleSpread); }
void ASWeaponInstant::ProcessInstantHit(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir) { if (MyPawn && MyPawn->IsLocallyControlled() && GetNetMode() == NM_Client) { // If we are a client and hit something that is controlled by server if (Impact.GetActor() && Impact.GetActor()->GetRemoteRole() == ROLE_Authority) { // Notify the server of our local hit to validate and apply actual hit damage. ServerNotifyHit(Impact, ShootDir); } else if (Impact.GetActor() == nullptr) { if (Impact.bBlockingHit) { ServerNotifyHit(Impact, ShootDir); } else { ServerNotifyMiss(ShootDir); } } } // Process a confirmed hit. ProcessInstantHitConfirmed(Impact, Origin, ShootDir); }