Add extra weapon pickup creation check for enemies
This commit is contained in:
parent
db5a5e229d
commit
09e4cd0f41
|
@ -91,10 +91,13 @@ void AEnemyAIController::OnDeath(FDamageInfo info)
|
||||||
|
|
||||||
enemy->SetLifeSpan(10.0f);
|
enemy->SetLifeSpan(10.0f);
|
||||||
|
|
||||||
|
if (enemy->DefaultWeaponInventory.Num() > 0)
|
||||||
|
{
|
||||||
auto weaponPickup = GetWorld()->SpawnActor<AWeaponPickup>();
|
auto weaponPickup = GetWorld()->SpawnActor<AWeaponPickup>();
|
||||||
weaponPickup->SetActorLocation(enemy->GetActorLocation());
|
weaponPickup->SetActorLocation(enemy->GetActorLocation());
|
||||||
weaponPickup->SetWeapon(enemy->DefaultWeaponInventory[enemy->GetCurrentInventorySlot()]);
|
weaponPickup->SetWeapon(enemy->DefaultWeaponInventory[enemy->GetCurrentInventorySlot()]);
|
||||||
weaponPickup->SetWeaponProperties(*enemy->CurrentWeapon->GetWeaponProperties());
|
weaponPickup->SetWeaponProperties(*enemy->CurrentWeapon->GetWeaponProperties());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AEnemyAIController::OnPerceptionUpdated(const TArray<AActor*>& actors)
|
void AEnemyAIController::OnPerceptionUpdated(const TArray<AActor*>& actors)
|
||||||
|
|
Loading…
Reference in New Issue