fix a bug with restarting, clean up some stuff, fix a playlist specific bug, add hold pickup to swap, fix shadow stones and stuff spawn height, code consistency, fix bugs with dropping
This commit is contained in:
Milxnor
2023-04-30 12:15:29 -04:00
parent 891f45f469
commit 18f92ccf52
24 changed files with 401 additions and 236 deletions

View File

@@ -4,6 +4,7 @@
#include "GameplayStatics.h"
#include "FortLootPackage.h"
#include "FortPickup.h"
#include "BuildingGameplayActor.h"
void SpawnBGAs() // hahah not "proper", there's a function that we can hook and it gets called on each spawner whenever playlist gets set, but it's fine.
{
@@ -12,6 +13,8 @@ void SpawnBGAs() // hahah not "proper", there's a function that we can hook and
if (!BGAConsumableSpawnerClass)
return;
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
auto AllBGAConsumableSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BGAConsumableSpawnerClass);
LOG_INFO(LogDev, "AllBGAConsumableSpawners.Num(): {}", (int)AllBGAConsumableSpawners.Num());
@@ -20,7 +23,17 @@ void SpawnBGAs() // hahah not "proper", there's a function that we can hook and
{
auto BGAConsumableSpawner = AllBGAConsumableSpawners.at(i);
auto SpawnLocation = BGAConsumableSpawner->GetActorLocation();
SpawnLocation.Z += 100;
if (FBuildingGameplayActorSpawnDetails::GetStruct())
{
// todo handle?
auto MapInfo = GameState->GetMapInfo();
}
else
{
// SpawnLocation.Z += 100;
}
static auto SpawnLootTierGroupOffset = BGAConsumableSpawner->GetOffset("SpawnLootTierGroup");
auto& SpawnLootTierGroup = BGAConsumableSpawner->Get<FName>(SpawnLootTierGroupOffset);
@@ -41,7 +54,13 @@ void SpawnBGAs() // hahah not "proper", there's a function that we can hook and
continue;
}
auto ConsumableActor = GetWorld()->SpawnActor<AActor>(StrongConsumableClass, SpawnLocation);
auto ConsumableActor = GetWorld()->SpawnActor<ABuildingGameplayActor>(StrongConsumableClass, SpawnLocation);
if (ConsumableActor)
{
// BeginDeferredActorSpawnFromClass ??
// ConsumableActor->InitializeBuildingActor(nullptr, nullptr, true); // idk UFortKismetLibrary::SpawnBuildingGameplayActor does this
}
}
}