diff --git a/Project Reboot 3.0/AthenaPlayerMatchReport.h b/Project Reboot 3.0/AthenaPlayerMatchReport.h index 037ae10..6acc892 100644 --- a/Project Reboot 3.0/AthenaPlayerMatchReport.h +++ b/Project Reboot 3.0/AthenaPlayerMatchReport.h @@ -12,8 +12,8 @@ struct FAthenaMatchTeamStats static auto GetStructSize() { return GetStruct()->GetPropertiesSize(); } - int Place; // 0x0000(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) - int TotalPlayers; // 0x0004(0x0004) (Edit, BlueprintVisible, BlueprintReadOnly, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + int Place; + int TotalPlayers; int& GetPlace() { @@ -49,7 +49,7 @@ public: static UClass* StaticClass() { - static auto Class = FindObject("/Script/FortniteGame.AthenaPlayerMatchReport"); + static auto Class = FindObject(L"/Script/FortniteGame.AthenaPlayerMatchReport"); return Class; } }; \ No newline at end of file diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.h b/Project Reboot 3.0/FortPlayerControllerAthena.h index 842bc68..33d4f84 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.h +++ b/Project Reboot 3.0/FortPlayerControllerAthena.h @@ -240,10 +240,15 @@ public: this->ProcessEvent(ClientOnPawnRevivedFn, &EventInstigator); } - bool& IsMarkedAlive() + bool IsMarkedAlive() { - static auto bMarkedAliveOffset = GetOffset("bMarkedAlive"); - return Get(bMarkedAliveOffset); + static auto bMarkedAliveOffset = GetOffset("bMarkedAlive", false); + + if (bMarkedAliveOffset == -1) // nots ure if this is possible + return true; + + static auto bMarkedAliveFieldMask = GetFieldMask(GetProperty("bMarkedAlive")); + return ReadBitfieldValue(bMarkedAliveOffset, bMarkedAliveFieldMask); } static void StartGhostModeHook(UObject* Context, FFrame* Stack, void* Ret); // we could native hook this but eh diff --git a/Project Reboot 3.0/FortPlayerPawnAthena.cpp b/Project Reboot 3.0/FortPlayerPawnAthena.cpp index 91b08b7..8864bd0 100644 --- a/Project Reboot 3.0/FortPlayerPawnAthena.cpp +++ b/Project Reboot 3.0/FortPlayerPawnAthena.cpp @@ -14,7 +14,7 @@ void AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook(UObject* Context, FFrame* bool bFromSweep; auto SweepResultPtr = (FHitResult*)std::realloc(0, FHitResult::GetStructSize()); - // LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!"); + LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!"); Stack->StepCompiledIn(&OverlappedComp); Stack->StepCompiledIn(&OtherActor); @@ -27,82 +27,29 @@ void AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook(UObject* Context, FFrame* // LOG_INFO(LogDev, "OtherActor: {}", __int64(OtherActor)); // LOG_INFO(LogDev, "OtherActorName: {}", OtherActor->IsValidLowLevel() ? OtherActor->GetName() : "BadRead") - - if (auto Pickup = Cast(OtherActor)) + + if (!Pawn->IsDBNO()) { - static auto PawnWhoDroppedPickupOffset = Pickup->GetOffset("PawnWhoDroppedPickup"); - - if (Pickup->Get(PawnWhoDroppedPickupOffset) != Pawn) + if (auto Pickup = Cast(OtherActor)) { - auto ItemDefinition = Pickup->GetPrimaryPickupItemEntry()->GetItemDefinition(); + static auto PawnWhoDroppedPickupOffset = Pickup->GetOffset("PawnWhoDroppedPickup"); - if (!ItemDefinition) + if (Pickup->Get(PawnWhoDroppedPickupOffset) != Pawn) { - return; - } + auto ItemDefinition = Pickup->GetPrimaryPickupItemEntry()->GetItemDefinition(); - auto PlayerController = Cast(Pawn->GetController()); - - if (!PlayerController) - { - return; - } - - auto WorldInventory = PlayerController->GetWorldInventory(); - - if (!WorldInventory) - { - return; - } - - auto& ItemInstances = WorldInventory->GetItemList().GetItemInstances(); - - bool ItemDefGoingInPrimary = IsPrimaryQuickbar(ItemDefinition); - int PrimarySlotsFilled = 0; - bool bCanStack = false; - bool bFoundStack = false; - - for (int i = 0; i < ItemInstances.Num(); ++i) - { - auto ItemInstance = ItemInstances.at(i); - - if (!ItemInstance) - continue; - - auto CurrentItemDefinition = ItemInstance->GetItemEntry()->GetItemDefinition(); - - if (!CurrentItemDefinition) - continue; - - if (ItemDefGoingInPrimary && IsPrimaryQuickbar(CurrentItemDefinition)) - PrimarySlotsFilled++; - - bool bIsInventoryFull = (PrimarySlotsFilled /* - 6 */) >= 5; - - if (CurrentItemDefinition == ItemDefinition) - { - bFoundStack = true; - - if (ItemInstance->GetItemEntry()->GetCount() < ItemDefinition->GetMaxStackSize()) - { - bCanStack = true; - break; - } - } - - if (bIsInventoryFull) + if (!ItemDefinition) { return; } + + if (!IsPrimaryQuickbar(ItemDefinition)) + { + ServerHandlePickupHook(Pawn, Pickup, 0.4f, FVector(), true); + } } - - // std::cout << "bCanStack: " << bCanStack << '\n'; - // std::cout << "bFoundStack: " << bFoundStack << '\n'; - - if (!bCanStack ? (!bFoundStack ? true : ItemDefinition->DoesAllowMultipleStacks()) : true) - ServerHandlePickupHook(Pawn, Pickup, 0.4f, FVector(), true); } } - // return OnCapsuleBeginOverlapOriginal(Context, Stack, Ret); + // return OnCapsuleBeginOverlapOriginal(Context, Stack, Ret); // we love explicit } \ No newline at end of file diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index b65a9f5..9e54f01 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -868,8 +868,8 @@ DWORD WINAPI Main(LPVOID) AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook, (PVOID*)&AFortPawn::NetMulticast_Athena_BatchedDamageCuesOriginal, false, true); Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPawn.MovingEmoteStopped"), AFortPawn::MovingEmoteStoppedHook, (PVOID*)&AFortPawn::MovingEmoteStoppedOriginal, false, true); - // Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") ? FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") : FindObject(L"/Script/FortniteGame.FortPlayerPawn.OnCapsuleBeginOverlap"), - // AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook, (PVOID*)&AFortPlayerPawnAthena::OnCapsuleBeginOverlapOriginal, false, true); + Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") ? FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") : FindObject(L"/Script/FortniteGame.FortPlayerPawn.OnCapsuleBeginOverlap"), + AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook, (PVOID*)&AFortPlayerPawnAthena::OnCapsuleBeginOverlapOriginal, false, true); Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveFortItemFromPlayer"), UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook, (PVOID*)&UFortKismetLibrary::K2_RemoveFortItemFromPlayerOriginal, false, true);