-
Notifications
You must be signed in to change notification settings - Fork 293
Open
Description
Shouldn't you be passing in say the DamageCauser AWeapon? It seems you are calculating damage from the player getting its EquippedWeapon??
void ULagCompensationComponent::ShotgunServerScoreRequest_Implementation(const TArray<ABlasterCharacter*>& HitCharacters, const FVector_NetQuantize& TraceStart, const TArray<FVector_NetQuantize>& HitLocations, float HitTime)
{
FShotgunServerSideRewindResult Confirm = ShotgunServerSideRewind(HitCharacters, TraceStart, HitLocations, HitTime);
for (auto& HitCharacter : HitCharacters)
{
if (HitCharacter == nullptr || HitCharacter->GetEquippedWeapon() == nullptr || Character == nullptr) continue;
float TotalDamage = 0.f;
if (Confirm.HeadShots.Contains(HitCharacter))
{
float HeadShotDamage = Confirm.HeadShots[HitCharacter] * HitCharacter->GetEquippedWeapon()->GetHeadShotDamage();
TotalDamage += HeadShotDamage;
}
if (Confirm.BodyShots.Contains(HitCharacter))
{
float BodyShotDamage = Confirm.BodyShots[HitCharacter] * HitCharacter->GetEquippedWeapon()->GetDamage();
TotalDamage += BodyShotDamage;
}
UGameplayStatics::ApplyDamage(
HitCharacter,
TotalDamage,
Character->Controller,
HitCharacter->GetEquippedWeapon(),
UDamageType::StaticClass()
);
}
}```Metadata
Metadata
Assignees
Labels
No labels