#pragma once #include "MyGameBaseWeapon.h" #include "weapon_pistol.generated.h" /** * */ UCLASS() class MyGame_API Aweapon_pistol : public AMyGameBaseWeapon { GENERATED_UCLASS_BODY() virtual void PrimaryFire(); /** process the instant hit and notify the server if necessary */ void ProcessInstantHit(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir, int32 RandomSeed, float ReticleSpread); /** server notified of hit from client to verify */ UFUNCTION(reliable, server, WithValidation) void ServerNotifyHit(const FHitResult Impact, FVector_NetQuantizeNormal ShootDir, int32 RandomSeed, float ReticleSpread); /** continue processing the instant hit, as if it has been confirmed by the server */ void ProcessInstantHit_Confirmed(const FHitResult& Impact, const FVector& Origin, const FVector& ShootDir, int32 RandomSeed, float ReticleSpread); /** check if weapon should deal damage to actor */ bool ShouldDealDamage(AActor* TestActor) const; };