fix s18 + teams with restarting + push before ability rewrite

This commit is contained in:
Milxnor
2023-03-31 13:49:33 -04:00
parent 052cfb6d61
commit 4d8b3a7ad1
3 changed files with 28 additions and 8 deletions

View File

@@ -616,13 +616,23 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
auto Playlist = GameState->GetCurrentPlaylist();
static int CurrentTeamMembers = 0; // bad
static int Current = 3;
static int LastNum = 1;
if (AmountOfRestarts != LastNum)
{
LastNum = AmountOfRestarts;
Current = 3;
CurrentTeamMembers = 0;
}
// std::cout << "Dru!\n";
if (!Playlist)
{
CurrentTeamMembers = 0;
static int Current = 3;
LOG_INFO(LogTeams, "Player is going on team {} with {} members (No Playlist).", Current, CurrentTeamMembers);
CurrentTeamMembers++;
return Current++;
@@ -630,6 +640,15 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
static int NextTeamIndex = Playlist->Get<uint8>("DefaultFirstTeam"); // + 1?
static int LastNum1 = 1;
if (AmountOfRestarts != LastNum1)
{
LastNum1 = AmountOfRestarts;
NextTeamIndex = Playlist->Get<uint8>("DefaultFirstTeam");
}
// std::cout << "CurrentTeamMembers: " << CurrentTeamMembers << '\n';
static auto MaxSquadSizeOffset = Playlist->GetOffset("MaxSquadSize");
@@ -766,8 +785,6 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
auto PlayerStateAthena = NewPlayer->GetPlayerStateAthena();
LOG_INFO(LogDev, "PlayerStateAthena: {}", __int64(PlayerStateAthena));
if (!PlayerStateAthena)
return Athena_HandleStartingNewPlayerOriginal(GameMode, NewPlayerActor);

View File

@@ -99,11 +99,14 @@ inline __int64 GetFunctionIdxOrPtr(UFunction* Function)
{
// LOG_INFO(LogDev, "0x{:x}", *(uint8_t*)(NativeAddr + i));
if ((*(uint8_t*)(NativeAddr + i) == 0x41 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF)) // wtf ue500
if (Fortnite_Version >= 19) // We should NOT do this, instead, if we expect a validate and we don't find before C3, then search for 0x41 0xFF.
{
LOG_INFO(LogDev, "Uhhhhhh report this to milxnor if u not on 18.40+ {}", Function->GetName());
bFoundValidate = true;
continue;
if ((*(uint8_t*)(NativeAddr + i) == 0x41 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF)) // wtf s18+
{
LOG_INFO(LogDev, "Uhhhhhh report this to milxnor if u not on s19+ {}", Function->GetName());
bFoundValidate = true;
continue;
}
}
if ((*(uint8_t*)(NativeAddr + i) == 0xFF && *(uint8_t*)(NativeAddr + i + 1) == 0x90) || // call qword ptr

View File

@@ -129,7 +129,7 @@ static __forceinline T* Cast(UObject* Object, bool bCheckType = true)
return nullptr;
}
extern inline int AmountOfRestarts = 0;
extern inline int AmountOfRestarts = 0; // DO NOT CHANGE
struct PlaceholderBitfield
{