Set `WeaponProperties` in `WeaponPickup` when dying

This commit is contained in:
Louis Hobbs 2023-02-12 20:32:03 +00:00
parent 84fbd00bea
commit ecff0b36a8
1 changed files with 5 additions and 0 deletions

View File

@ -76,6 +76,11 @@ void AEnemyAIController::OnDeath(FDamageInfo info)
} }
enemy->SetLifeSpan(10.0f); enemy->SetLifeSpan(10.0f);
auto weaponPickup = GetWorld()->SpawnActor<AWeaponPickup>();
weaponPickup->SetActorLocation(enemy->GetActorLocation());
weaponPickup->SetWeapon(enemy->DefaultWeaponInventory[enemy->GetCurrentInventorySlot()]);
weaponPickup->SetWeaponProperties(*enemy->CurrentWeapon->GetWeaponProperties());
} }
void AEnemyAIController::OnPerceptionUpdated(const TArray<AActor*>& actors) void AEnemyAIController::OnPerceptionUpdated(const TArray<AActor*>& actors)