mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
Reboot Living up to its name
almost finish rebooting (im going insane), performance, increase llama spawn radius, remove auto restart for a little bit
This commit is contained in:
35
Project Reboot 3.0/FortGameSessionDedicatedAthena.cpp
Normal file
35
Project Reboot 3.0/FortGameSessionDedicatedAthena.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "FortGameSessionDedicatedAthena.h"
|
||||
#include "GameplayStatics.h"
|
||||
#include "FortPlayerStateAthena.h"
|
||||
|
||||
#include "FortPlayerControllerAthena.h"
|
||||
#include "OnlineReplStructs.h"
|
||||
|
||||
uint8 AFortGameSessionDedicatedAthena::GetSquadIdForCurrentPlayerHook(AFortGameSessionDedicatedAthena* GameSessionDedicated, __int64 UniqueId)
|
||||
{
|
||||
LOG_INFO(LogDev, "GetSquadIdForCurrentPlayerHook!");
|
||||
|
||||
TArray<AActor*> CONTRTOLLERS = UGameplayStatics::GetAllActorsOfClass(GetWorld(), AFortPlayerControllerAthena::StaticClass());
|
||||
|
||||
for (int i = 0; i < CONTRTOLLERS.Num(); i++)
|
||||
{
|
||||
auto Controller = (AFortPlayerControllerAthena*)CONTRTOLLERS.at(i);
|
||||
auto PlayerState = Cast<AFortPlayerStateAthena>(Controller->GetPlayerState());
|
||||
|
||||
if (!PlayerState)
|
||||
continue;
|
||||
|
||||
static auto UniqueIdOffset = PlayerState->GetOffset("UniqueId");
|
||||
|
||||
if (PlayerState->GetPtr<FUniqueNetIdRepl>(UniqueIdOffset)->IsIdentical((FUniqueNetIdRepl*)&UniqueId))
|
||||
{
|
||||
return PlayerState->GetTeamIndex() - 3;
|
||||
}
|
||||
}
|
||||
|
||||
CONTRTOLLERS.Free();
|
||||
|
||||
LOG_INFO(LogDev, "Failed to find SquadId!");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user