preload, starting shield

This commit is contained in:
Milxnor
2023-06-26 09:38:40 -04:00
parent 3f8ca2888e
commit a67fe1a361
4 changed files with 65 additions and 11 deletions

View File

@@ -390,6 +390,8 @@ void AFortPlayerControllerAthena::ServerTeleportToPlaygroundLobbyIslandHook(AFor
void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerController* Controller, APawn* Pawn)
{
static auto AcknowledgedPawnOffset = Controller->GetOffset("AcknowledgedPawn");
const APawn* OldAcknowledgedPawn = Controller->Get<APawn*>(AcknowledgedPawnOffset);
Controller->Get<APawn*>(AcknowledgedPawnOffset) = Pawn;
auto ControllerAsFort = Cast<AFortPlayerController>(Controller);
@@ -399,6 +401,11 @@ void AFortPlayerControllerAthena::ServerAcknowledgePossessionHook(APlayerControl
if (!PawnAsFort)
return;
if (OldAcknowledgedPawn != PawnAsFort)
{
PawnAsFort->SetShield(StartingShield);
}
if (Globals::bNoMCP)
{
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart");