Merge branch 'teo'

This commit is contained in:
Gray
2024-03-15 19:36:04 -04:00
8 changed files with 20 additions and 40 deletions

View File

@@ -18,7 +18,7 @@ public:
UObject* ReplacedBuilding; // this also not on like below 18.00 UObject* ReplacedBuilding; // this also not on like below 18.00
} IBAParams{ BuildingOwner, Controller, bUsePlayerBuildAnimations, ReplacedBuilding }; } 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); this->ProcessEvent(fn, &IBAParams);
} }

View File

@@ -1156,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++; CurrentTeamMembers++;
@@ -1226,7 +1226,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass"); static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
UObject* OverrideBattleBusSkin = nullptr; 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) 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) if (!WorldInventory)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret); return ServerCreateBuildingActorOriginal(Context, Stack, Ret);
auto PlayerStateAthena = Cast<AFortPlayerStateAthena>(PlayerController->GetPlayerState()); auto PlayerStateAthena = Cast<AFortPlayerStateAthena, false>(PlayerController->GetPlayerState());
if (!PlayerStateAthena) if (!PlayerStateAthena)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret); return ServerCreateBuildingActorOriginal(Context, Stack, Ret);
@@ -885,7 +885,7 @@ void AFortPlayerController::ServerCreateBuildingActorHook(UObject* Context, FFra
if (!BuildingClass) if (!BuildingClass)
return ServerCreateBuildingActorOriginal(Context, Stack, Ret); 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(); auto StructuralSupportSystem = GameState->GetStructuralSupportSystem();
@@ -1707,11 +1707,7 @@ void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerContr
AFortWeap_EditingTool* EditTool = nullptr; AFortWeap_EditingTool* EditTool = nullptr;
#if 1
EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid())); EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid()));
#else
EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
#endif
if (!EditTool) if (!EditTool)
return; return;
@@ -1783,25 +1779,7 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl
if (!WorldInventory) if (!WorldInventory)
return; return;
AFortWeap_EditingTool* EditTool = nullptr; AFortWeap_EditingTool* EditTool = Cast<AFortWeap_EditingTool>(Pawn->GetCurrentWeapon());
#if 1
auto EditToolInstance = WorldInventory->FindItemInstance(EditToolDef);
if (!EditToolInstance)
return;
FGuid EditToolGuid = EditToolInstance->GetItemEntry()->GetItemGuid(); // Should we ref?
#if 1
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
if (EditTool) if (EditTool)
{ {

View File

@@ -961,7 +961,8 @@
</ClInclude> </ClInclude>
<ClInclude Include="TSubclassOf.h"> <ClInclude Include="TSubclassOf.h">
<Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter> <Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter>
<ClInclude Include="finder.h"> </ClInclude>
<ClInclude Include="finder.h">
<Filter>Reboot\Public</Filter> <Filter>Reboot\Public</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>

View File

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

View File

@@ -212,7 +212,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex"); static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject<UFunction>("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex");
SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn); SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn);
auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections(); auto& ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections();
// Rift Tour // Rift Tour
if (Fortnite_Version == 17.30) if (Fortnite_Version == 17.30)
@@ -248,11 +248,11 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
} }
if (Index == 2) // Slide if (Index == 2) // Slide
{ {
auto Script = FindObject<UObject>("/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4"); auto Script = FindObject<UObject>(L"/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4");
auto SplineActor = Script->Get<AActor*>(Script->GetOffset("SplineActor")); auto SplineActor = Script->Get<AActor*>(Script->GetOffset("SplineActor"));
auto PawnLocation = Script->Get<AActor*>(Script->GetOffset("PawnLocation")) = SplineActor; auto PawnLocation = Script->Get<AActor*>(Script->GetOffset("PawnLocation")) = SplineActor;
auto AllWrapsSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>("/Script/SpecialEventGameplayRuntime.FortSpecialRelevancyActorSpawner")); auto AllWrapsSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>(L"/Script/SpecialEventGameplayRuntime.FortSpecialRelevancyActorSpawner"));
for (int i = 0; i < AllWrapsSpawners.Num(); i++) for (int i = 0; i < AllWrapsSpawners.Num(); i++)
{ {
@@ -266,11 +266,11 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
if (CurrentWrapSpawner->GetName().contains("WrapChangePickup")) if (CurrentWrapSpawner->GetName().contains("WrapChangePickup"))
{ {
ClassToSpawn = FindObject<UClass>("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_WrapChangePickup.BP_Buffet_Paint_WrapChangePickup_C"); ClassToSpawn = FindObject<UClass>(L"/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_WrapChangePickup.BP_Buffet_Paint_WrapChangePickup_C");
} }
else if (CurrentWrapSpawner->GetName().contains("Paint_Pickup")) else if (CurrentWrapSpawner->GetName().contains("Paint_Pickup"))
{ {
ClassToSpawn = FindObject<UClass>("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_Pickup.BP_Buffet_Paint_Pickup_C"); ClassToSpawn = FindObject<UClass>(L"/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_Pickup.BP_Buffet_Paint_Pickup_C");
} }
auto SpawnedWrap = GetWorld()->SpawnActor<AActor>(ClassToSpawn, WrapSpawnerLocation, WrapSpawnerRotation.Quaternion(), FVector(1, 1, 1), auto SpawnedWrap = GetWorld()->SpawnActor<AActor>(ClassToSpawn, WrapSpawnerLocation, WrapSpawnerRotation.Quaternion(), FVector(1, 1, 1),
CreateSpawnParameters(ESpawnActorCollisionHandlingMethod::AlwaysSpawn, true, nullptr)); CreateSpawnParameters(ESpawnActorCollisionHandlingMethod::AlwaysSpawn, true, nullptr));
@@ -292,8 +292,8 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
for (int i = 0; i < ClientConnections.Num(); i++) for (int i = 0; i < ClientConnections.Num(); i++)
{ {
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
auto CurrentController = ClientConnections.At(i)->GetPlayerController(); auto CurrentController = ClientConnections.At(i)->GetPlayerController();
auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn();
if (!CurrentPawn) if (!CurrentPawn)
continue; continue;
@@ -368,7 +368,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
SendMessageToConsole(CurrentController, L"Gave WID_Buffet_BeatMatchingBoomBox!"); SendMessageToConsole(CurrentController, L"Gave WID_Buffet_BeatMatchingBoomBox!");
} }
auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>("/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C")); auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject<UClass>(L"/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C"));
for (int i = 0; i < AllWeps.Num(); i++) for (int i = 0; i < AllWeps.Num(); i++)
{ {
@@ -382,7 +382,7 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index)
} }
if (Index == 6) // Ariana if (Index == 6) // Ariana
{ {
auto ReflectScript = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Stars_2"); auto ReflectScript = FindObject(L"/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Stars_2");
for (int i = 0; i < ClientConnections.Num(); i++) for (int i = 0; i < ClientConnections.Num(); i++)
{ {

View File

@@ -1460,6 +1460,7 @@ static inline DWORD WINAPI GuiThread(LPVOID)
// Initialize Direct3D // Initialize Direct3D
if (!CreateDeviceD3D(hwnd)) if (!CreateDeviceD3D(hwnd))
{ {
LOG_ERROR(LogDev, "Failed to create D3D Device!");
CleanupDeviceD3D(); CleanupDeviceD3D();
::UnregisterClass(wc.lpszClassName, wc.hInstance); ::UnregisterClass(wc.lpszClassName, wc.hInstance);
return 1; return 1;

View File

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