Bugfix Merge Errors

This commit is contained in:
RAFAL SWIERCZEK 2024-02-02 11:42:15 +00:00
parent d943495179
commit fe671e10fc
7 changed files with 28 additions and 18 deletions

View File

@ -53,8 +53,11 @@ void AEndlessVendettaCharacter::BeginPlay()
Super::BeginPlay();
UEVGameInstance* GI = Cast<UEVGameInstance>(GetWorld()->GetGameInstance());
if (IsValid(GI->MainSaveGameInstanceRef))
{
PrimaryWeaponClass = GI->MainSaveGameInstanceRef->PrimaryWeaponClassSave;
SecondaryWeaponClass = GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave;
}
// Set the fp skeletal mesh for the vault it plugin to use
TArray<UActorComponent*> MeshActComps = GetComponentsByClass(USkeletalMeshComponent::StaticClass());
@ -481,8 +484,12 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
PrimaryWeaponClass = Outhit->GetClass();
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (IsValid(GI->MainSaveGameInstanceRef))
{
GI->MainSaveGameInstanceRef->PrimaryWeaponClassSave = Outhit->GetClass();
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
}
Outhit->Destroy();
EquipPrimary();
@ -497,8 +504,11 @@ void AEndlessVendettaCharacter::WeaponSwitcher(AActor* Outhit)
SecondaryWeaponClass = Outhit->GetClass();
UEVGameInstance* GI = Cast<UEVGameInstance>(GetGameInstance());
if (IsValid(GI->MainSaveGameInstanceRef))
{
GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave = Outhit->GetClass();
UGameplayStatics::SaveGameToSlot(GI->MainSaveGameInstanceRef, "MainSave", 0);
}
Outhit->Destroy();
EquipSecondary();