creative stuff

This commit is contained in:
Milxnor
2023-03-13 22:03:18 -04:00
parent 2fd7f3b23f
commit 818bc8119b
23 changed files with 393 additions and 45 deletions

View File

@@ -4,6 +4,7 @@
#include "SoftObjectPtr.h"
#include "globals.h"
#include "GameplayStatics.h"
void ApplyCID(AFortPlayerPawn* Pawn, UObject* CID)
{
@@ -51,6 +52,32 @@ void ApplyCID(AFortPlayerPawn* Pawn, UObject* CID)
}
}
void AFortPlayerControllerAthena::ServerTeleportToPlaygroundLobbyIslandHook(AFortPlayerControllerAthena* Controller)
{
auto Pawn = Controller->GetMyFortPawn();
if (!Pawn)
return;
static auto FortPlayerStartCreativeClass = FindObject<UClass>("/Script/FortniteGame.FortPlayerStartCreative");
auto AllCreativePlayerStarts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortPlayerStartCreativeClass);
for (int i = 0; i < AllCreativePlayerStarts.Num(); i++)
{
auto CurrentPlayerStart = AllCreativePlayerStarts.at(i);
static auto PlayerStartTagsOffset = CurrentPlayerStart->GetOffset("PlayerStartTags");
auto bHasSpawnTag = CurrentPlayerStart->Get<FGameplayTagContainer>(PlayerStartTagsOffset).Contains("Playground.LobbyIsland.Spawn");
if (!bHasSpawnTag)
continue;
Pawn->TeleportTo(CurrentPlayerStart->GetActorLocation(), Pawn->GetActorRotation());
}
AllCreativePlayerStarts.Free();
}
void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerController* Controller, APawn* Pawn)
{
static auto AcknowledgedPawnOffset = Controller->GetOffset("AcknowledgedPawn");