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);
|
||||||
|
|
||||||
auto weaponPickup = GetWorld()->SpawnActor<AWeaponPickup>();
|
if (enemy->DefaultWeaponInventory.Num() > 0)
|
||||||
weaponPickup->SetActorLocation(enemy->GetActorLocation());
|
{
|
||||||
weaponPickup->SetWeapon(enemy->DefaultWeaponInventory[enemy->GetCurrentInventorySlot()]);
|
auto weaponPickup = GetWorld()->SpawnActor<AWeaponPickup>();
|
||||||
weaponPickup->SetWeaponProperties(*enemy->CurrentWeapon->GetWeaponProperties());
|
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)
|
||||||
|
|
Loading…
Reference in New Issue