From 1b24b28d952d0746cf434ff81fa61ee661d83a8f Mon Sep 17 00:00:00 2001 From: Milxnor Date: Tue, 14 Mar 2023 20:00:31 -0400 Subject: [PATCH] fix old map size --- .../AbilitySystemComponent_Abilities.cpp | 14 ++++++++------ Project Reboot 3.0/FortLootPackage.cpp | 7 +++++-- Project Reboot 3.0/FortPlayerController.cpp | 17 +++++++++++++++++ Project Reboot 3.0/dllmain.cpp | 4 +--- Project Reboot 3.0/globals.h | 2 +- Project Reboot 3.0/log.h | 2 -- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/Project Reboot 3.0/AbilitySystemComponent_Abilities.cpp b/Project Reboot 3.0/AbilitySystemComponent_Abilities.cpp index a91e392..dcdbd2f 100644 --- a/Project Reboot 3.0/AbilitySystemComponent_Abilities.cpp +++ b/Project Reboot 3.0/AbilitySystemComponent_Abilities.cpp @@ -54,8 +54,10 @@ void InternalServerTryActivateAbility(UAbilitySystemComponent* AbilitySystemComp return; } + static auto InputPressedOffset = FindOffsetStruct("/Script/GameplayAbilities.GameplayAbilitySpec", "InputPressed"); + UGameplayAbility* InstancedAbility = nullptr; - SetBitfield(Spec, 1, true); // InputPressed = true + SetBitfield((PlaceholderBitfield*)(__int64(Spec) + InputPressedOffset), 1, true); // InputPressed = true bool res = false; @@ -71,16 +73,16 @@ void InternalServerTryActivateAbility(UAbilitySystemComponent* AbilitySystemComp LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Rejecting ClientActivation of {}. InternalTryActivateAbility failed: ", AbilityToActivate->GetName()); AbilitySystemComponent->ClientActivateAbilityFailed(Handle, *(int16_t*)(__int64(PredictionKey) + CurrentOffset)); - SetBitfield(Spec, 1, false); // InputPressed = false + SetBitfield((PlaceholderBitfield*)(__int64(Spec) + InputPressedOffset), 1, false); // InputPressed = false + + static auto ActivatableAbilitiesOffset = AbilitySystemComponent->GetOffset("ActivatableAbilities"); + AbilitySystemComponent->Get(ActivatableAbilitiesOffset).MarkItemDirty(Spec); } else { - LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Activated {}", AbilityToActivate->GetName()); + // LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Activated {}", AbilityToActivate->GetName()); } - static auto ActivatableAbilitiesOffset = AbilitySystemComponent->GetOffset("ActivatableAbilities"); - AbilitySystemComponent->Get(ActivatableAbilitiesOffset).MarkItemDirty(Spec); // we only need to do this if the ability fails but eh - // bro ignore this next part idk where to put it ok /* static auto OwnerActorOffset = AbilitySystemComponent->GetOffset("OwnerActor"); diff --git a/Project Reboot 3.0/FortLootPackage.cpp b/Project Reboot 3.0/FortLootPackage.cpp index af6735a..f48981d 100644 --- a/Project Reboot 3.0/FortLootPackage.cpp +++ b/Project Reboot 3.0/FortLootPackage.cpp @@ -78,6 +78,9 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs { std::vector LootDrops; + if (recursive > 10) + return LootDrops; + static std::vector LTDTables; static std::vector LPTables; @@ -209,8 +212,8 @@ std::vector PickLootDrops(FName TierGroupName, bool bPrint, int recurs } } - if (SumLootPackageCategoryWeightArray > SumLootPackageCategoryMinArray) - return PickLootDrops(TierGroupName, bPrint, ++recursive); // hm + // if (SumLootPackageCategoryWeightArray > SumLootPackageCategoryMinArray) + // return PickLootDrops(TierGroupName, bPrint, ++recursive); // hm std::vector TierGroupLPs; diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index 4acd83d..fc404cf 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -37,6 +37,23 @@ void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController auto ItemDefinition = ItemInstance->GetItemEntry()->GetItemDefinition(); + static auto FortGadgetItemDefinitionClass = FindObject("/Script/FortniteGame.FortGadgetItemDefinition"); + + if (ItemDefinition->IsA(FortGadgetItemDefinitionClass)) + { + static auto GetWeaponItemDefinition = FindObject("/Script/FortniteGame.FortGadgetItemDefinition.GetWeaponItemDefinition"); + + if (GetWeaponItemDefinition) + { + ItemDefinition->ProcessEvent(GetWeaponItemDefinition, &ItemDefinition); + } + else + { + static auto GetDecoItemDefinition = FindObject("/Script/FortniteGame.FortGadgetItemDefinition.GetDecoItemDefinition"); + ItemDefinition->ProcessEvent(GetDecoItemDefinition, &ItemDefinition); + } + } + if (auto DecoItemDefinition = Cast(ItemDefinition)) { Pawn->PickUpActor(nullptr, DecoItemDefinition); // todo check ret value? diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 777ad88..cddaa53 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -292,7 +292,7 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook((PVOID)Addresses::CompletePickupAnimation, (PVOID)AFortPickup::CompletePickupAnimationHook, (PVOID*)&AFortPickup::CompletePickupAnimationOriginal); Hooking::MinHook::Hook((PVOID)Addresses::CanActivateAbility, ReturnTrueHook); // ahhh wtf // Hooking::MinHook::Hook((PVOID)FindFunctionCall(L"ServerRemoveInventoryItem"), UFortInventoryInterface::RemoveInventoryItemHook); - + AddVehicleHook(); LOG_INFO(LogDev, "Test: 0x{:x}", FindFunctionCall(L"ClientOnPawnDied") - __int64(GetModuleHandleW(0))); @@ -323,8 +323,6 @@ DWORD WINAPI Main(LPVOID) LOG_INFO(LogHook, "GetMaxTickRateIndex {}", GetMaxTickRateIndex); */ - - srand(time(0)); LOG_INFO(LogHook, "Finished!"); diff --git a/Project Reboot 3.0/globals.h b/Project Reboot 3.0/globals.h index 50ebbc7..9c301c7 100644 --- a/Project Reboot 3.0/globals.h +++ b/Project Reboot 3.0/globals.h @@ -4,7 +4,7 @@ namespace Globals { extern inline bool bCreative = false; extern inline bool bGoingToPlayEvent = false; - extern inline bool bNoMCP = false; + extern inline bool bNoMCP = true; extern inline bool bLateGame = false; extern inline bool bAbilitiesEnabled = true; } \ No newline at end of file diff --git a/Project Reboot 3.0/log.h b/Project Reboot 3.0/log.h index 7203b76..ed2efcc 100644 --- a/Project Reboot 3.0/log.h +++ b/Project Reboot 3.0/log.h @@ -43,8 +43,6 @@ inline void InitLogger() FILE* stream = nullptr; - // bad but idk how to stop printing - freopen_s(&stream, "in.txt", "r", stdin); freopen_s(&stream, "out.txt", "w+", stdout); freopen_s(&stream, "err.txt", "w", stderr);