blaster/Source/Blaster/Pickups/AmmoPickup.cpp

20 lines
438 B
C++
Raw Normal View History

2022-05-22 20:56:28 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "AmmoPickup.h"
#include "Blaster/Character/BlasterCharacter.h"
#include "Blaster/Components/CombatComponent.h"
2022-05-23 21:45:28 +00:00
void AAmmoPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
2022-05-22 20:56:28 +00:00
{
2022-05-23 21:45:28 +00:00
Super::OnOverlap(BlasterCharacter);
2022-05-22 20:56:28 +00:00
2022-05-23 21:45:28 +00:00
if (UCombatComponent* Combat = BlasterCharacter->GetCombat())
2022-05-22 20:56:28 +00:00
{
2022-05-23 21:45:28 +00:00
Combat->PickupAmmo(WeaponType, AmmoAmount);
2022-05-22 20:56:28 +00:00
}
Destroy();
}