Narrowing

This commit is contained in:
2025-07-10 02:10:37 -07:00
parent 989c3afe3a
commit 67d03675fa
6 changed files with 82 additions and 82 deletions
@@ -456,7 +456,12 @@ void UEBPlayerWeaponController::ApplyWeaponData(UEBWeaponData* WeaponData)
{
UEBWeaponData* PreviousWeapon = CurrentWeaponData;
CurrentWeaponData = WeaponData;
// Set WeaponData on the WeaponActor as well
if (WeaponActor)
{
WeaponActor->WeaponData = WeaponData;
}
// Debug logging if enabled
if (CurrentWeaponData && CurrentWeaponData->bEnableFireDebug)
{
@@ -464,16 +469,16 @@ void UEBPlayerWeaponController::ApplyWeaponData(UEBWeaponData* WeaponData)
UE_LOG(LogTemp, Warning, TEXT("[WEAPON DEBUG] - Previous Weapon: %s"), PreviousWeapon ? *PreviousWeapon->WeaponName.ToString() : TEXT("None"));
UE_LOG(LogTemp, Warning, TEXT("[WEAPON DEBUG] - New Weapon: %s"), WeaponData ? *WeaponData->WeaponName.ToString() : TEXT("None"));
}
// Apply to weapon actor
InternalApplyWeaponData(WeaponData);
// Update ammo
UpdateAmmoFromWeaponData();
// Broadcast event
OnWeaponChanged.Broadcast(WeaponData);
if (CurrentWeaponData && CurrentWeaponData->bEnableFireDebug)
{
UE_LOG(LogTemp, Warning, TEXT("[WEAPON DEBUG] ApplyWeaponData() completed - weapon data applied and events broadcast"));