mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
@@ -4,60 +4,22 @@
|
||||
#include "FortGameModeAthena.h"
|
||||
#include "gui.h"
|
||||
|
||||
void ABuildingContainer::BuildingContainer_SetMeshSet(FMeshSet* MeshSet)
|
||||
{
|
||||
BuildingSMActor_SetMeshSet(MeshSet);
|
||||
|
||||
// if (!NewSearchedMesh && !BuildingContainer->ShouldDestroyOnSearch()) error
|
||||
|
||||
this->GetSearchedMesh() = MeshSet->GetSearchedMesh();
|
||||
|
||||
if (!IsAlreadySearched())
|
||||
{
|
||||
// todo clear StaticMeshComponent->OverrideMaterials
|
||||
|
||||
// todo reapply StaticMaterials
|
||||
}
|
||||
|
||||
static auto SearchSpeedOffset = GetOffset("SearchSpeed");
|
||||
Get<FCurveTableRowHandle>(SearchSpeedOffset) = MeshSet->GetSearchSpeed();
|
||||
|
||||
if (MeshSet->GetLootNoiseLoudness() < 0)
|
||||
{
|
||||
this->GetLootNoiseRange() = MeshSet->GetLootNoiseRange();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->GetLootNoiseRange() = MeshSet->GetLootNoiseLoudness() * 1000;
|
||||
// MeshSet->GetLootNoiseLoudness() = // IDKK;
|
||||
}
|
||||
|
||||
this->GetLootSpawnLocation() = MeshSet->GetLootSpawnLocation();
|
||||
}
|
||||
|
||||
__m128 ToM128(const FVector& Vec)
|
||||
{
|
||||
std::array<float, 4> Arr = { Vec.X, Vec.Y, Vec.Z, 0.0f };
|
||||
return _mm_loadu_ps(Arr.data());
|
||||
}
|
||||
|
||||
bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
|
||||
{
|
||||
if (!Pawn)
|
||||
return false;
|
||||
|
||||
this->ForceNetUpdate();
|
||||
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||
|
||||
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + FVector{ 0, 0, 50 }; // proper?
|
||||
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorRightVector() * 70.f + FVector{ 0, 0, 50 };
|
||||
|
||||
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup");
|
||||
auto RedirectedLootTier = GameMode->RedirectLootTier(this->Get<FName>(SearchLootTierGroupOffset));
|
||||
|
||||
// LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString());
|
||||
|
||||
auto LootDrops = PickLootDrops(RedirectedLootTier, GameState->GetWorldLevel(), -1, bDebugPrintLooting);
|
||||
|
||||
// LOG_INFO(LogInteraction, "LootDrops.size(): {}", LootDrops.size());
|
||||
|
||||
for (auto& LootDrop : LootDrops)
|
||||
{
|
||||
PickupCreateData CreateData{};
|
||||
@@ -72,66 +34,17 @@ bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
|
||||
auto NewPickup = AFortPickup::SpawnPickup(CreateData);
|
||||
}
|
||||
|
||||
if (this->GetLootNoiseRange() > 0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (!this->IsDestroyed())
|
||||
{
|
||||
this->ForceNetUpdate();
|
||||
// a buncha other stuff
|
||||
}
|
||||
|
||||
static auto SearchAnimationCountOffset = FindOffsetStruct("/Script/FortniteGame.FortSearchBounceData", "SearchAnimationCount");
|
||||
static auto BounceNormalOffset = FindOffsetStruct("/Script/FortniteGame.FortSearchBounceData", "BounceNormal");
|
||||
static auto SearchBounceDataOffset = this->GetOffset("SearchBounceData");
|
||||
|
||||
auto SearchBounceData = this->GetPtr<void>(SearchBounceDataOffset);
|
||||
|
||||
auto PawnLocation = Pawn->GetActorLocation();
|
||||
|
||||
// thanks openai
|
||||
|
||||
__m128 v149 = ToM128(PawnLocation);
|
||||
FVector BuildingContainerLocation = this->GetActorLocation();
|
||||
__m128 v150 = ToM128(BuildingContainerLocation);
|
||||
|
||||
// Calculate v150 and v149 as before
|
||||
v150.m128_f32[0] = PawnLocation.X - BuildingContainerLocation.X;
|
||||
v149.m128_f32[0] = PawnLocation.Y - BuildingContainerLocation.Y;
|
||||
|
||||
// Use the unpacklo_ps intrinsic to interleave the two __m128 vectors
|
||||
__m128 result = _mm_unpacklo_ps(v150, v149);
|
||||
|
||||
// Convert the result to a uint64_t using a union
|
||||
union {
|
||||
__m128i m128i;
|
||||
uint64_t u64;
|
||||
} data{};
|
||||
data.m128i = _mm_castps_si128(result);
|
||||
|
||||
*(uint64*)(__int64(SearchBounceData) + BounceNormalOffset) = data.u64; // this will set x and y
|
||||
(*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).Z = 0;
|
||||
|
||||
auto BounceNormalSquared = (*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).SizeSquared();
|
||||
|
||||
if (BounceNormalSquared > 0.0000000099999999)
|
||||
{
|
||||
float v155 = FMath::InvSqrt(BounceNormalSquared);
|
||||
float v156 = v155 + (float)(v155 * (float)(0.5 - (float)((float)(BounceNormalSquared * 0.5) * (float)(v155 * v155))));
|
||||
float idk = v156 + (float)(v156 * (float)(0.5 - (float)((float)(BounceNormalSquared * 0.5) * (float)(v156 * v156))));
|
||||
float v157 = (*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).Y * idk;
|
||||
float v158 = (*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).Z * idk;
|
||||
(*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).X = (*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).X * idk;
|
||||
(*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).Y = v157;
|
||||
(*(FVector*)(__int64(SearchBounceData) + BounceNormalOffset)).Z = v158;
|
||||
}
|
||||
|
||||
(*(int*)(__int64(SearchBounceData) + SearchAnimationCountOffset))++;
|
||||
|
||||
static auto BounceContainerFn = FindObject<UFunction>("/Script/FortniteGame.BuildingContainer.BounceContainer");
|
||||
this->ProcessEvent(BounceContainerFn);
|
||||
static auto OnRep_bAlreadySearchedFn = FindObject<UFunction>(L"/Script/FortniteGame.BuildingContainer.OnRep_bAlreadySearched");
|
||||
this->ProcessEvent(OnRep_bAlreadySearchedFn);
|
||||
|
||||
// Now there is some function called here but idk what it is, it calls OnLoot though.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -13,52 +13,6 @@ public:
|
||||
return this->ReadBitfieldValue(bDestroyContainerOnSearchOffset, bDestroyContainerOnSearchFieldMask);
|
||||
}
|
||||
|
||||
UStaticMesh*& GetSearchedMesh()
|
||||
{
|
||||
static auto SearchedMeshOffset = GetOffset("SearchedMesh");
|
||||
return Get<UStaticMesh*>(SearchedMeshOffset);
|
||||
}
|
||||
|
||||
UStaticMesh*& GetStaticMesh()
|
||||
{
|
||||
static auto StaticMeshOffset = GetOffset("StaticMesh");
|
||||
return Get<UStaticMesh*>(StaticMeshOffset);
|
||||
}
|
||||
|
||||
void BuildingContainer_SetMeshSet(FMeshSet* MeshSet);
|
||||
|
||||
bool IsAlreadySearched()
|
||||
{
|
||||
static auto bAlreadySearchedOffset = this->GetOffset("bAlreadySearched");
|
||||
static auto bAlreadySearchedFieldMask = GetFieldMask(this->GetProperty("bAlreadySearched"));
|
||||
return this->ReadBitfieldValue(bAlreadySearchedOffset, bAlreadySearchedFieldMask);
|
||||
}
|
||||
|
||||
void SetAlreadySearched(bool bNewValue, bool bOnRep = true)
|
||||
{
|
||||
static auto bAlreadySearchedOffset = this->GetOffset("bAlreadySearched");
|
||||
static auto bAlreadySearchedFieldMask = GetFieldMask(this->GetProperty("bAlreadySearched"));
|
||||
this->SetBitfieldValue(bAlreadySearchedOffset, bAlreadySearchedFieldMask, bNewValue);
|
||||
|
||||
if (bOnRep)
|
||||
{
|
||||
static auto OnRep_bAlreadySearchedFn = FindObject<UFunction>(L"/Script/FortniteGame.BuildingContainer.OnRep_bAlreadySearched");
|
||||
this->ProcessEvent(OnRep_bAlreadySearchedFn);
|
||||
}
|
||||
}
|
||||
|
||||
FVector& GetLootSpawnLocation()
|
||||
{
|
||||
static auto LootSpawnLocationOffset = GetOffset("LootSpawnLocation");
|
||||
return Get<FVector>(LootSpawnLocationOffset);
|
||||
}
|
||||
|
||||
float& GetLootNoiseRange()
|
||||
{
|
||||
static auto LootNoiseRangeOffset = GetOffset("LootNoiseRange");
|
||||
return Get<float>(LootNoiseRangeOffset);
|
||||
}
|
||||
|
||||
bool SpawnLoot(AFortPawn* Pawn);
|
||||
|
||||
static UClass* StaticClass()
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
#include "BuildingSMActor.h"
|
||||
|
||||
void ABuildingSMActor::BuildingSMActor_SetMeshSet(FMeshSet* MeshSet)
|
||||
{
|
||||
static auto BreakEffectOffset = GetOffset("BreakEffect");
|
||||
Get<UParticleSystem*>(BreakEffectOffset) = MeshSet->GetBreakEffect();
|
||||
|
||||
static auto ConstructedEffectOffset = GetOffset("ConstructedEffect");
|
||||
Get<UParticleSystem*>(ConstructedEffectOffset) = MeshSet->GetConstructedEffect();
|
||||
}
|
||||
|
||||
UClass* ABuildingSMActor::StaticClass()
|
||||
{
|
||||
static auto Class = FindObject<UClass>(L"/Script/FortniteGame.BuildingSMActor");
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "BuildingActor.h"
|
||||
#include "PlayerState.h"
|
||||
#include "CurveTable.h"
|
||||
|
||||
enum class EFortResourceType : uint8_t
|
||||
{
|
||||
@@ -14,90 +13,6 @@ enum class EFortResourceType : uint8_t
|
||||
EFortResourceType_MAX = 5
|
||||
};
|
||||
|
||||
using UStaticMesh = UObject;
|
||||
using UStaticMeshComponent = UObject;
|
||||
using UParticleSystem = UObject;
|
||||
|
||||
struct FMeshSet
|
||||
{
|
||||
static UStruct* GetStruct()
|
||||
{
|
||||
static auto Struct = FindObject<UStruct>(L"/Script/FortniteGame.MeshSet");
|
||||
return Struct;
|
||||
}
|
||||
|
||||
static int GetPropertiesSize() { return GetStruct()->GetPropertiesSize(); }
|
||||
|
||||
UStaticMesh* GetBaseMesh()
|
||||
{
|
||||
static auto BaseMeshOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "BaseMesh");
|
||||
return *(UStaticMesh**)(__int64(this) + BaseMeshOffset);
|
||||
}
|
||||
|
||||
UStaticMesh* GetSearchedMesh()
|
||||
{
|
||||
static auto SearchedMeshOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "SearchedMesh");
|
||||
return *(UStaticMesh**)(__int64(this) + SearchedMeshOffset);
|
||||
}
|
||||
|
||||
EFortResourceType& GetResourceType()
|
||||
{
|
||||
static auto ResourceTypeOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "ResourceType");
|
||||
return *(EFortResourceType*)(__int64(this) + ResourceTypeOffset);
|
||||
}
|
||||
|
||||
float& GetLootNoiseRange()
|
||||
{
|
||||
static auto LootNoiseRangeOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "LootNoiseRange");
|
||||
return *(float*)(__int64(this) + LootNoiseRangeOffset);
|
||||
}
|
||||
|
||||
FVector& GetLootSpawnLocation()
|
||||
{
|
||||
static auto LootSpawnLocationOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "LootSpawnLocation");
|
||||
return *(FVector*)(__int64(this) + LootSpawnLocationOffset);
|
||||
}
|
||||
|
||||
float& GetLootNoiseLoudness()
|
||||
{
|
||||
static auto LootNoiseLoudnessOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "LootNoiseLoudness");
|
||||
return *(float*)(__int64(this) + LootNoiseLoudnessOffset);
|
||||
}
|
||||
|
||||
FCurveTableRowHandle& GetSearchSpeed()
|
||||
{
|
||||
static auto SearchSpeedOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "SearchSpeed");
|
||||
return *(FCurveTableRowHandle*)(__int64(this) + SearchSpeedOffset);
|
||||
}
|
||||
|
||||
UParticleSystem*& GetConstructedEffect()
|
||||
{
|
||||
static auto ConstructedEffectOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "ConstructedEffect");
|
||||
return *(UParticleSystem**)(__int64(this) + ConstructedEffectOffset);
|
||||
}
|
||||
|
||||
UParticleSystem*& GetBreakEffect()
|
||||
{
|
||||
static auto BreakEffectOffset = FindOffsetStruct("/Script/FortniteGame.MeshSet", "BreakEffect");
|
||||
return *(UParticleSystem**)(__int64(this) + BreakEffectOffset);
|
||||
}
|
||||
};
|
||||
|
||||
struct FTierMeshSets
|
||||
{
|
||||
int32& GetTier()
|
||||
{
|
||||
static auto TierOffset = FindOffsetStruct("/Script/FortniteGame.TierMeshSets", "Tier");
|
||||
return *(int32*)(__int64(this) + TierOffset);
|
||||
}
|
||||
|
||||
TArray<FMeshSet>& GetMeshSets()
|
||||
{
|
||||
static auto MeshSetsOffset = FindOffsetStruct("/Script/FortniteGame.TierMeshSets", "MeshSets");
|
||||
return *(TArray<FMeshSet>*)(__int64(this) + MeshSetsOffset);
|
||||
}
|
||||
};
|
||||
|
||||
class ABuildingSMActor : public ABuildingActor
|
||||
{
|
||||
public:
|
||||
@@ -108,20 +23,6 @@ public:
|
||||
return ReadBitfieldValue(bPlayerPlacedOffset, bPlayerPlacedFieldMask);
|
||||
}
|
||||
|
||||
TArray<FTierMeshSets>& GetAlternateMeshes()
|
||||
{
|
||||
static auto AlternateMeshesOffset = GetOffset("AlternateMeshes");
|
||||
return Get<TArray<FTierMeshSets>>(AlternateMeshesOffset);
|
||||
}
|
||||
|
||||
int32& GetAltMeshIdx()
|
||||
{
|
||||
static auto AltMeshIdxOffset = GetOffset("AltMeshIdx");
|
||||
return Get<int32>(AltMeshIdxOffset);
|
||||
}
|
||||
|
||||
void BuildingSMActor_SetMeshSet(FMeshSet* MeshSet);
|
||||
|
||||
void SetPlayerPlaced(bool NewValue)
|
||||
{
|
||||
static auto bPlayerPlacedOffset = GetOffset("bPlayerPlaced");
|
||||
@@ -141,12 +42,6 @@ public:
|
||||
return Get<int>(CurrentBuildingLevelOffset);
|
||||
}
|
||||
|
||||
UStaticMeshComponent*& GetStaticMeshComponent()
|
||||
{
|
||||
static auto StaticMeshComponentOffset = GetOffset("StaticMeshComponent");
|
||||
return Get<UStaticMeshComponent*>(StaticMeshComponentOffset);
|
||||
}
|
||||
|
||||
EFortResourceType& GetResourceType()
|
||||
{
|
||||
static auto ResourceTypeOffset = GetOffset("ResourceType");
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
if (LoadoutTeam.TeamIndex == TeamIndex)
|
||||
{
|
||||
if (LoadoutTeam.UpdateOverrideType != EAthenaInventorySpawnOverride::NoOverride)
|
||||
return LoadoutTeam.UpdateOverrideType; // this is temporary!
|
||||
return LoadoutTeam.UpdateOverrideType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
if (LoadoutTeam.TeamIndex == TeamIndex)
|
||||
{
|
||||
if (LoadoutTeam.DropAllItemsOverride != EAthenaLootDropOverride::NoOverride)
|
||||
return LoadoutTeam.DropAllItemsOverride; // this is temporary!
|
||||
return LoadoutTeam.DropAllItemsOverride;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "calendar.h"
|
||||
#include "gui.h"
|
||||
#include <random>
|
||||
#include "die.h"
|
||||
|
||||
static UFortPlaylist* GetPlaylistToUse()
|
||||
{
|
||||
@@ -166,8 +165,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
|
||||
if (currentBasePlaylist)
|
||||
{
|
||||
// GameMode->SetCurrentPlaylistName(currentBasePlaylist);
|
||||
// GameState->SetPlaylistId(currentBasePlaylist);
|
||||
GameMode->SetCurrentPlaylistName(currentBasePlaylist);
|
||||
GameState->SetPlaylistId(currentBasePlaylist);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -180,8 +179,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
|
||||
if (GameState->Get(CurrentPlaylistDataOffset))
|
||||
{
|
||||
// GameMode->SetCurrentPlaylistName(GameState->Get<UFortPlaylist*>(CurrentPlaylistDataOffset));
|
||||
// GameState->SetPlaylistId(GameState->Get<UFortPlaylist*>(CurrentPlaylistDataOffset));
|
||||
GameMode->SetCurrentPlaylistName(GameState->Get<UFortPlaylist*>(CurrentPlaylistDataOffset));
|
||||
GameState->SetPlaylistId(GameState->Get<UFortPlaylist*>(CurrentPlaylistDataOffset));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,8 +416,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
}
|
||||
|
||||
static auto bWorldIsReadyOffset = GameMode->GetOffset("bWorldIsReady");
|
||||
static auto bWorldIsReadyFieldMask = GetFieldMask(GameMode->GetProperty("bWorldIsReady"));
|
||||
GameMode->SetBitfieldValue(bWorldIsReadyOffset, bWorldIsReadyFieldMask, true); // idk when we actually set this
|
||||
SetBitfield(GameMode->GetPtr<PlaceholderBitfield>(bWorldIsReadyOffset), 1, true); // idk when we actually set this
|
||||
|
||||
// Calendar::SetSnow(1000);
|
||||
|
||||
@@ -555,15 +553,10 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
|
||||
GetWorld()->Listen();
|
||||
|
||||
FixBuildingContainers();
|
||||
|
||||
LOG_INFO(LogDev, "WorldLevel: {}", GameState->GetWorldLevel());
|
||||
|
||||
if (false)
|
||||
{
|
||||
SetupAIDirector();
|
||||
SetupServerBotManager();
|
||||
}
|
||||
|
||||
bool bPrintCommonObjectPaths = true;
|
||||
|
||||
@@ -642,7 +635,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
{
|
||||
if (CurrentObject->GetFullName().contains(WorldNamesToStreamAllFoundationsIn.at(z)))
|
||||
{
|
||||
// I think we only have to set bServerStreamedInLevel but whatever.
|
||||
// I think we only have to set bServerStreamedInLevel.
|
||||
ShowFoundation((AActor*)CurrentObject);
|
||||
continue;
|
||||
}
|
||||
@@ -651,7 +644,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
}
|
||||
|
||||
Globals::bStartedListening = true;
|
||||
// LOG_INFO(LogDev, "Finished listening!");
|
||||
}
|
||||
|
||||
bool Ret = false;
|
||||
|
||||
@@ -406,7 +406,7 @@ std::vector<LootDrop> PickLootDrops(FName TierGroupName, int WorldLevel, int For
|
||||
// LTDTables.push_back(LoadObject<UDataTable>(L"/Game/Athena/Playlists/Playground/AthenaLootTierData_Client.AthenaLootTierData_Client"));
|
||||
// LPTables.push_back(LoadObject<UDataTable>(L"/Game/Athena/Playlists/Playground/AthenaLootPackages_Client.AthenaLootPackages_Client"));
|
||||
|
||||
static auto FortGameFeatureDataClass = FindObject<UClass>(L"/Script/FortniteGame.FortGameFeatureData");
|
||||
static auto FortGameFeatureDataClass = FindObject<UClass>("/Script/FortniteGame.FortGameFeatureData");
|
||||
|
||||
if (FortGameFeatureDataClass)
|
||||
{
|
||||
|
||||
@@ -433,12 +433,17 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
|
||||
|
||||
if (auto BuildingContainer = Cast<ABuildingContainer>(ReceivingActor))
|
||||
{
|
||||
if (BuildingContainer->IsAlreadySearched())
|
||||
static auto bAlreadySearchedOffset = BuildingContainer->GetOffset("bAlreadySearched");
|
||||
static auto bAlreadySearchedFieldMask = GetFieldMask(BuildingContainer->GetProperty("bAlreadySearched"));
|
||||
|
||||
if (BuildingContainer->ReadBitfieldValue(bAlreadySearchedOffset, bAlreadySearchedFieldMask))
|
||||
return;
|
||||
|
||||
BuildingContainer->SpawnLoot(PlayerController->GetMyFortPawn());
|
||||
// LOG_INFO(LogInteraction, "bAlreadySearchedFieldMask: {}", bAlreadySearchedFieldMask);
|
||||
|
||||
BuildingContainer->SetAlreadySearched(true);
|
||||
BuildingContainer->SetBitfieldValue(bAlreadySearchedOffset, bAlreadySearchedFieldMask, true);
|
||||
|
||||
BuildingContainer->SpawnLoot(PlayerController->GetMyFortPawn());
|
||||
|
||||
// if (BuildingContainer->ShouldDestroyOnSearch())
|
||||
// BuildingContainer->K2_DestroyActor();
|
||||
@@ -1469,7 +1474,6 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
||||
}
|
||||
|
||||
return ClientOnPawnDiedOriginal(PlayerController, DeathReport);
|
||||
return ClientOnPawnDiedOriginal(PlayerController, DeathReport);
|
||||
}
|
||||
|
||||
bool IsBuildingOkForEditing(ABuildingSMActor* BuildingActorToEdit)
|
||||
|
||||
@@ -21,11 +21,6 @@ public:
|
||||
return (A <= B) ? A : B;
|
||||
}
|
||||
|
||||
static FORCEINLINE float InvSqrt(float F)
|
||||
{
|
||||
return 1.0f / sqrtf(F);
|
||||
}
|
||||
|
||||
static FORCENOINLINE float Fmod(float X, float Y);
|
||||
|
||||
static FORCEINLINE int32 FloorToInt(float F)
|
||||
|
||||
@@ -250,7 +250,6 @@
|
||||
<ClCompile Include="Object.cpp" />
|
||||
<ClCompile Include="PlayerController.cpp" />
|
||||
<ClCompile Include="PlayerState.cpp" />
|
||||
<ClCompile Include="reboot.cpp" />
|
||||
<ClCompile Include="SavePackage.cpp" />
|
||||
<ClCompile Include="UnrealMath.cpp" />
|
||||
<ClCompile Include="UnrealNames.cpp" />
|
||||
|
||||
@@ -274,9 +274,6 @@
|
||||
<ClCompile Include="FortLootLevel.cpp">
|
||||
<Filter>FortniteGame\Source\FortniteGame\Private\Items</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="reboot.cpp">
|
||||
<Filter>Reboot\Private</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="log.h" />
|
||||
|
||||
@@ -32,14 +32,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
T* GetByWeakObject()
|
||||
{
|
||||
if (SoftObjectPtr.ObjectID.AssetPathName.ComparisonIndex.Value <= 0)
|
||||
return nullptr;
|
||||
|
||||
return GetObjectByIndex(SoftObjectPtr.WeakPtr.ObjectIndex);
|
||||
}
|
||||
|
||||
T* Get(UClass* ClassToLoad = nullptr, bool bTryToLoad = false)
|
||||
{
|
||||
if (Engine_Version <= 416)
|
||||
|
||||
@@ -20,9 +20,6 @@ public:
|
||||
return FVector{ this->X - A.X, this->Y - A.Y, this->Z - A.Z };
|
||||
}
|
||||
|
||||
|
||||
FORCEINLINE FVector operator*(float Scale) const;
|
||||
|
||||
FORCEINLINE float SizeSquared() const
|
||||
{
|
||||
return X * X + Y * Y + Z * Z;
|
||||
@@ -53,8 +50,3 @@ public:
|
||||
*this = *this - A;
|
||||
}
|
||||
};
|
||||
|
||||
FORCEINLINE FVector FVector::operator*(float Scale) const
|
||||
{
|
||||
return FVector(X * Scale, Y * Scale, Z * Scale);
|
||||
}
|
||||
@@ -291,9 +291,6 @@ void Addresses::FindAll()
|
||||
LOG_INFO(LogDev, "Finding PickSupplyDropLocation");
|
||||
Addresses::PickSupplyDropLocation = FindPickSupplyDropLocation();
|
||||
|
||||
LOG_INFO(LogDev, "Finding LoadAsset");
|
||||
Addresses::LoadAsset = FindLoadAsset();
|
||||
|
||||
LOG_INFO(LogDev, "Finished finding!");
|
||||
}
|
||||
|
||||
@@ -362,7 +359,6 @@ void Addresses::Print()
|
||||
LOG_INFO(LogDev, "CombinePickupLea: 0x{:x}", CombinePickupLea - Base);
|
||||
LOG_INFO(LogDev, "CreateBuildingActorCallForDeco: 0x{:x}", CreateBuildingActorCallForDeco - Base);
|
||||
LOG_INFO(LogDev, "PickSupplyDropLocation: 0x{:x}", PickSupplyDropLocation - Base);
|
||||
LOG_INFO(LogDev, "LoadAsset: 0x{:x}", LoadAsset - Base);
|
||||
}
|
||||
|
||||
void Offsets::FindAll()
|
||||
|
||||
@@ -69,7 +69,6 @@ namespace Addresses
|
||||
extern inline uint64 CombinePickupLea = 0;
|
||||
extern inline uint64 CreateBuildingActorCallForDeco = 0;
|
||||
extern inline uint64 PickSupplyDropLocation = 0;
|
||||
extern inline uint64 LoadAsset = 0;
|
||||
|
||||
void SetupVersion(); // Finds Engine Version
|
||||
void FindAll();
|
||||
|
||||
@@ -76,7 +76,7 @@ static void SetupServerBotManager()
|
||||
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
|
||||
static auto FortServerBotManagerClass = FindObject<UClass>(L"/Script/FortniteGame.FortServerBotManagerAthena"); // Is there a BP for this? // GameMode->ServerBotManagerClass
|
||||
static auto FortServerBotManagerClass = FindObject<UClass>("/Script/FortniteGame.FortServerBotManagerAthena"); // Is there a BP for this? // GameMode->ServerBotManagerClass
|
||||
|
||||
if (!FortServerBotManagerClass)
|
||||
return;
|
||||
@@ -92,13 +92,11 @@ static void SetupServerBotManager()
|
||||
static auto CachedGameModeOffset = ServerBotManager->GetOffset("CachedGameMode");
|
||||
ServerBotManager->Get(CachedGameModeOffset) = GameMode;
|
||||
|
||||
static auto CachedGameStateOffset = ServerBotManager->GetOffset("CachedGameState", false);
|
||||
|
||||
if (CachedGameStateOffset != -1)
|
||||
static auto CachedGameStateOffset = ServerBotManager->GetOffset("CachedGameState");
|
||||
ServerBotManager->Get(CachedGameStateOffset) = GameState;
|
||||
|
||||
static auto CachedBotMutatorOffset = ServerBotManager->GetOffset("CachedBotMutator");
|
||||
ServerBotManager->Get(CachedBotMutatorOffset) = FindFirstMutator(FindObject<UClass>(L"/Script/FortniteGame.FortAthenaMutator_Bots"));
|
||||
ServerBotManager->Get(CachedBotMutatorOffset) = FindFirstMutator(FindObject<UClass>("/Script/FortniteGame.FortAthenaMutator_Bots"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +105,7 @@ static void SetupAIDirector()
|
||||
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
|
||||
static auto AIDirectorClass = FindObject<UClass>(L"/Script/FortniteGame.AthenaAIDirector"); // Probably wrong class
|
||||
static auto AIDirectorClass = FindObject<UClass>("/Script/FortniteGame.AthenaAIDirector"); // Probably wrong class
|
||||
|
||||
if (!AIDirectorClass)
|
||||
return;
|
||||
|
||||
@@ -174,7 +174,7 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration;
|
||||
}
|
||||
|
||||
static inline void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
|
||||
void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
|
||||
{
|
||||
if (!Object || !Function)
|
||||
return;
|
||||
@@ -331,22 +331,3 @@ static inline void ProcessEventHook(UObject* Object, UFunction* Function, void*
|
||||
|
||||
return Object->ProcessEvent(Function, Parameters);
|
||||
}
|
||||
|
||||
static inline void FixBuildingContainers()
|
||||
{
|
||||
if (Fortnite_Version > 2)
|
||||
return;
|
||||
|
||||
auto AllBuildingContainers = UGameplayStatics::GetAllActorsOfClass(GetWorld(), ABuildingContainer::StaticClass());
|
||||
|
||||
for (int i = 0; i < AllBuildingContainers.size(); i++)
|
||||
{
|
||||
auto BuildingContainer = (ABuildingContainer*)AllBuildingContainers.at(i);
|
||||
|
||||
// TODO Figure it out proper (i think its something like this)
|
||||
|
||||
// BuildingContainer->GetAltMeshIdx() = BuildingContainer->GetAlternateMeshes().Num() > 0 ? BuildingContainer->GetAlternateMeshes().Num() - 1 : 0;
|
||||
}
|
||||
|
||||
AllBuildingContainers.Free();
|
||||
}
|
||||
@@ -442,11 +442,8 @@ DWORD WINAPI Main(LPVOID)
|
||||
|
||||
// Hooking::MinHook::Hook(FortPlayerControllerZoneDefault->VFTable[0xD0 / 8], CanCreateInCurrentContextHook, (PVOID*)&CanCreateInCurrentContextOriginal);
|
||||
|
||||
if (false)
|
||||
{
|
||||
HookInstruction(Addresses::UpdateTrackedAttributesLea, (PVOID)UFortGadgetItemDefinition::UpdateTrackedAttributesHook, "/Script/FortniteGame.FortPlayerController.Suicide", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault);
|
||||
HookInstruction(Addresses::CombinePickupLea, (PVOID)AFortPickup::CombinePickupHook, "/Script/Engine.PlayerController.SetVirtualJoystickVisibility", ERelativeOffsets::LEA, FortPlayerControllerAthenaDefault);
|
||||
}
|
||||
|
||||
Hooking::MinHook::Hook(FortWeaponDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortWeapon.ServerReleaseWeaponAbility"),
|
||||
AFortWeapon::ServerReleaseWeaponAbilityHook, (PVOID*)&AFortWeapon::ServerReleaseWeaponAbilityOriginal, false, true);
|
||||
|
||||
@@ -165,22 +165,6 @@ static inline uint64 FindPickupInitialize()
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline uint64 FindLoadAsset()
|
||||
{
|
||||
auto Addrr = Memcury::Scanner::FindStringRef(L"Loaded delay-load asset %s").Get();
|
||||
|
||||
for (int i = 0; i < 2000; i++)
|
||||
{
|
||||
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x89 &&
|
||||
(*(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0x74 || *(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0x6C))
|
||||
{
|
||||
return Addrr - i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline uint64 FindCreateNetDriver()
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#include "reboot.h"
|
||||
|
||||
#include "SoftObjectPtr.h"
|
||||
|
||||
#include "KismetStringLibrary.h"
|
||||
|
||||
inline UObject* Assets::LoadAsset(FName Name, bool ShowDelayTimes)
|
||||
{
|
||||
static UObject* (*LoadAssetOriginal)(FName a1, bool a2);
|
||||
|
||||
return LoadAssetOriginal(Name, ShowDelayTimes);
|
||||
}
|
||||
|
||||
inline UObject* Assets::LoadSoftObject(void* SoftObjectPtr)
|
||||
{
|
||||
if (Engine_Version == 416)
|
||||
{
|
||||
auto tAssetPtr = (TAssetPtr<UObject>*)SoftObjectPtr;
|
||||
// return LoadAsset(tAssetPtr->AssetPtr.ObjectID.AssetLongPathname.);
|
||||
return nullptr; // later
|
||||
}
|
||||
|
||||
auto tSoftObjectPtr = (TSoftObjectPtr<UObject>*)SoftObjectPtr;
|
||||
|
||||
// if (auto WeakObject = tSoftObjectPtr->GetByWeakObject())
|
||||
// return WeakObject;
|
||||
|
||||
return LoadAsset(tSoftObjectPtr->SoftObjectPtr.ObjectID.AssetPathName);
|
||||
}
|
||||
@@ -384,12 +384,6 @@ static void CopyStruct(void* Dest, void* Src, size_t Size, UStruct* Struct = nul
|
||||
}
|
||||
}
|
||||
|
||||
class Assets
|
||||
{
|
||||
static inline UObject* LoadAsset(FName Name, bool ShowDelayTimes = false);
|
||||
static inline UObject* LoadSoftObject(void* SoftObjectPtr);
|
||||
};
|
||||
|
||||
template <typename T = __int64>
|
||||
static T* Alloc(size_t Size = sizeof(T), bool bUseFMemoryRealloc = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user