blaster/Source/Blaster/Pickups/AmmoPickup.cpp

20 lines
438 B
C++

// 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"
void AAmmoPickup::OnOverlap(ABlasterCharacter* BlasterCharacter)
{
Super::OnOverlap(BlasterCharacter);
if (UCombatComponent* Combat = BlasterCharacter->GetCombat())
{
Combat->PickupAmmo(WeaponType, AmmoAmount);
}
Destroy();
}