This commit is contained in:
Gray
2024-03-15 19:35:51 -04:00
parent 0f6a279420
commit 496e452160
5 changed files with 9 additions and 44 deletions

View File

@@ -18,7 +18,7 @@ public:
UObject* ReplacedBuilding; // this also not on like below 18.00
} IBAParams{ BuildingOwner, Controller, bUsePlayerBuildAnimations, ReplacedBuilding };
static auto fn = FindObject<UFunction>("/Script/FortniteGame.BuildingActor.InitializeKismetSpawnedBuildingActor");
static auto fn = FindObject<UFunction>(L"/Script/FortniteGame.BuildingActor.InitializeKismetSpawnedBuildingActor");
this->ProcessEvent(fn, &IBAParams);
}

View File

@@ -986,19 +986,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
LOG_INFO(LogDev, "bShouldUseReplicationGraph: {}", Globals::bShouldUseReplicationGraph);
if (Fortnite_Version >= 2.42 && Fortnite_Version < 3.4)
{
static auto FortHLODSMActorClass = FindObject<UClass>("/Script/FortniteGame.FortHLODSMActor");
auto FortHLODSMActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortHLODSMActorClass);
for (int i = 0; i < FortHLODSMActors.Num(); ++i)
{
FortHLODSMActors.at(i)->K2_DestroyActor();
}
LOG_INFO(LogDev, "Destroyed HLODs!");
}
Globals::bStartedListening = true;
}
@@ -1169,7 +1156,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
}
}
LOG_INFO(LogTeams, "Spreading Teams {} Player is going on team {}/{} with {} members.", bShouldSpreadTeams, NextTeamIndex, TeamsNum, CurrentTeamMembers);
LOG_INFO(LogTeams, "Spreading Teams {} Player is going on team {}/{} with {} members.", bShouldSpreadTeams, NextTeamIndex - 2, TeamsNum, CurrentTeamMembers);
CurrentTeamMembers++;
@@ -1239,7 +1226,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
UObject* OverrideBattleBusSkin = nullptr;
UClass* OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass);
UClass* OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass); // wrong for some builds but its ok
if (Fortnite_Version == 1.11 || Fortnite_Version == 7.30 || Fortnite_Version == 11.31 || Fortnite_Version == 15.10 || Fortnite_Version == 19.10)
{

View File

@@ -842,7 +842,7 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra
if (!WorldInventory)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret);
auto PlayerStateAthena = Cast<AFortPlayerStateAthena>(PlayerController->GetPlayerState());
auto PlayerStateAthena = Cast<AFortPlayerStateAthena, false>(PlayerController->GetPlayerState());
if (!PlayerStateAthena)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret);
@@ -885,7 +885,7 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra
if (!BuildingClass)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret);
auto GameState = Cast<AFortGameStateAthena>(Cast<AFortGameMode>(GetWorld()->GetGameMode(), false)->GetGameState(), false);
auto GameState = Cast<AFortGameStateAthena, false>(Cast<AFortGameMode, false>(GetWorld()->GetGameMode())->GetGameState());
auto StructuralSupportSystem = GameState->GetStructuralSupportSystem();
@@ -1707,11 +1707,7 @@ void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerContr
AFortWeap_EditingTool* EditTool = nullptr;
#if 1
EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid()));
#else
EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
#endif
if (!EditTool)
return;
@@ -1783,25 +1779,7 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl
if (!WorldInventory)
return;
AFortWeap_EditingTool* EditTool = nullptr;
#if 1
auto EditToolInstance = WorldInventory->FindItemInstance(EditToolDef);
if (!EditToolInstance)
return;
FGuid EditToolGuid = EditToolInstance->GetItemEntry()->GetItemGuid(); // Should we ref?
#if 0
EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM
#else
Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolGuid)); // ERM
EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
#endif
#else
EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
#endif
AFortWeap_EditingTool* EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
if (EditTool)
{

View File

@@ -478,7 +478,7 @@ void Offsets::FindAll()
}
if (Fortnite_Version == 3.2)
{
Offsets::NetworkObjectList = 0x4F8;
Offsets::NetworkObjectList = 0x500;
Offsets::ClientWorldPackageName = 0x1820;
}
if (Fortnite_Version == 3.2 || Fortnite_Version == 3.3)

View File

@@ -122,8 +122,8 @@ static inline UObject* GetLocalPlayerController()
return LocalPlayer->Get(PlayerControllerOffset);
}
template <typename T>
static __forceinline T* Cast(UObject* Object, bool bCheckType = true)
template <typename T, bool bCheckType = true>
static __forceinline T* Cast(UObject* Object)
{
if (bCheckType)
{