remove HLOD and manual GamePhase setting

This commit is contained in:
ApfelTeeSaft
2025-06-25 18:54:34 +02:00
parent 6070d21056
commit 24ccfc7ecd
-76
View File
@@ -20,82 +20,6 @@ namespace ProcessEventNamespace
Globals::bBeaconInitialized = true;
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "Set Globals::bBeaconInitialized to true");
auto World = Globals::GetWorld();
if (World && World->GameState)
{
auto GameState = reinterpret_cast<SDK::AFortGameStateAthena*>(GameMode->GameState);
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "Got GameState");
if (GameState)
{
GameState->GamePhase = SDK::EAthenaGamePhase::Warmup;
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "GameState->GamePhase is now EAthenaGamePhase::Warmup");
GameState->OnRep_GamePhase(SDK::EAthenaGamePhase::None);
}
}
if (World)
{
try
{
auto GameplayStatics = SDK::UGameplayStatics::GetDefaultObj();
if (!GameplayStatics)
{
Logging::SafeLog(ELogEvent::Warning, ELogType::ProcessEvent, "UGameplayStatics::GetDefaultObj() returned null");
}
else
{
auto HLODStaticClass = SDK::AFortHLODSMActor::StaticClass();
if (!HLODStaticClass)
{
Logging::SafeLog(ELogEvent::Warning, ELogType::ProcessEvent, "AFortHLODSMActor::StaticClass() returned null");
}
else
{
SDK::TArray<SDK::AActor*> OutHLODs;
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "Attempting to get HLOD actors...");
GameplayStatics->GetAllActorsOfClass(World, HLODStaticClass, &OutHLODs);
if (OutHLODs.IsValid() && OutHLODs.Num() > 0)
{
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "Found %d HLOD actors to destroy", OutHLODs.Num());
int destroyedCount = 0;
for (int i = 0; i < OutHLODs.Num(); i++)
{
try
{
auto Actor = OutHLODs[i];
if (Actor && !Actor->bActorIsBeingDestroyed)
{
Actor->K2_DestroyActor();
destroyedCount++;
}
}
catch (...)
{
Logging::SafeLog(ELogEvent::Warning, ELogType::ProcessEvent, "Exception destroying HLOD actor at index %d", i);
continue;
}
}
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "Successfully destroyed %d HLOD Actors", destroyedCount);
}
else
{
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "No HLOD actors found or array is invalid");
}
OutHLODs.Clear();
Logging::SafeLog(ELogEvent::Info, ELogType::ProcessEvent, "HLOD array cleared successfully");
}
}
}
catch (...)
{
Logging::SafeLog(ELogEvent::Error, ELogType::ProcessEvent, "Exception during HLOD cleanup - continuing anyway");
}
}
}
catch (...)
{