quite a bit

llamas, fix some ltm specific stuff, add auto bus start for auto restart,  work in progress lategame on 1.11, fix a crash, performance
This commit is contained in:
Milxnor
2023-05-04 20:46:48 -04:00
parent f49f166c2d
commit a4ed589aab
31 changed files with 477 additions and 93 deletions

View File

@@ -586,8 +586,6 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent)
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); // We want to be teleported back to the UFO but we dont use chooseplayerstart
LOG_INFO(LogDev, "PlayerController: {}", __int64(PlayerController));
if (!PlayerController)
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
@@ -597,13 +595,25 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
auto GameMode = (AFortGameModeAthena*)GetWorld()->GetGameMode();
auto GameState = GameMode->GetGameStateAthena();
static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
AActor* AircraftToJumpFrom = nullptr;
if (Aircrafts->Num() <= 0)
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
if (AircraftsOffset == -1)
{
static auto AircraftOffset = GameState->GetOffset("Aircraft");
AircraftToJumpFrom = GameState->Get<AActor*>(AircraftOffset);
}
else
{
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
AircraftToJumpFrom = Aircrafts->Num() > 0 ? Aircrafts->at(0) : nullptr;
}
if (!AircraftToJumpFrom)
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, Aircrafts->at(0));
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, AircraftToJumpFrom);
PlayerController->Possess(NewPawn);
auto NewPawnAsFort = Cast<AFortPawn>(NewPawn);