fix old map size

This commit is contained in:
Milxnor
2023-03-14 20:00:31 -04:00
parent 818bc8119b
commit 1b24b28d95
6 changed files with 32 additions and 14 deletions

View File

@@ -54,8 +54,10 @@ void InternalServerTryActivateAbility(UAbilitySystemComponent* AbilitySystemComp
return; return;
} }
static auto InputPressedOffset = FindOffsetStruct("/Script/GameplayAbilities.GameplayAbilitySpec", "InputPressed");
UGameplayAbility* InstancedAbility = nullptr; UGameplayAbility* InstancedAbility = nullptr;
SetBitfield(Spec, 1, true); // InputPressed = true SetBitfield((PlaceholderBitfield*)(__int64(Spec) + InputPressedOffset), 1, true); // InputPressed = true
bool res = false; bool res = false;
@@ -71,16 +73,16 @@ void InternalServerTryActivateAbility(UAbilitySystemComponent* AbilitySystemComp
LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Rejecting ClientActivation of {}. InternalTryActivateAbility failed: ", AbilityToActivate->GetName()); LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Rejecting ClientActivation of {}. InternalTryActivateAbility failed: ", AbilityToActivate->GetName());
AbilitySystemComponent->ClientActivateAbilityFailed(Handle, *(int16_t*)(__int64(PredictionKey) + CurrentOffset)); 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<FFastArraySerializer>(ActivatableAbilitiesOffset).MarkItemDirty(Spec);
} }
else else
{ {
LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Activated {}", AbilityToActivate->GetName()); // LOG_INFO(LogAbilities, "InternalServerTryActivateAbility. Activated {}", AbilityToActivate->GetName());
} }
static auto ActivatableAbilitiesOffset = AbilitySystemComponent->GetOffset("ActivatableAbilities");
AbilitySystemComponent->Get<FFastArraySerializer>(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 // bro ignore this next part idk where to put it ok
/* static auto OwnerActorOffset = AbilitySystemComponent->GetOffset("OwnerActor"); /* static auto OwnerActorOffset = AbilitySystemComponent->GetOffset("OwnerActor");

View File

@@ -78,6 +78,9 @@ std::vector<LootDrop> PickLootDrops(FName TierGroupName, bool bPrint, int recurs
{ {
std::vector<LootDrop> LootDrops; std::vector<LootDrop> LootDrops;
if (recursive > 10)
return LootDrops;
static std::vector<UDataTable*> LTDTables; static std::vector<UDataTable*> LTDTables;
static std::vector<UDataTable*> LPTables; static std::vector<UDataTable*> LPTables;
@@ -209,8 +212,8 @@ std::vector<LootDrop> PickLootDrops(FName TierGroupName, bool bPrint, int recurs
} }
} }
if (SumLootPackageCategoryWeightArray > SumLootPackageCategoryMinArray) // if (SumLootPackageCategoryWeightArray > SumLootPackageCategoryMinArray)
return PickLootDrops(TierGroupName, bPrint, ++recursive); // hm // return PickLootDrops(TierGroupName, bPrint, ++recursive); // hm
std::vector<FFortLootPackageData*> TierGroupLPs; std::vector<FFortLootPackageData*> TierGroupLPs;

View File

@@ -37,6 +37,23 @@ void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController
auto ItemDefinition = ItemInstance->GetItemEntry()->GetItemDefinition(); auto ItemDefinition = ItemInstance->GetItemEntry()->GetItemDefinition();
static auto FortGadgetItemDefinitionClass = FindObject<UClass>("/Script/FortniteGame.FortGadgetItemDefinition");
if (ItemDefinition->IsA(FortGadgetItemDefinitionClass))
{
static auto GetWeaponItemDefinition = FindObject<UFunction>("/Script/FortniteGame.FortGadgetItemDefinition.GetWeaponItemDefinition");
if (GetWeaponItemDefinition)
{
ItemDefinition->ProcessEvent(GetWeaponItemDefinition, &ItemDefinition);
}
else
{
static auto GetDecoItemDefinition = FindObject<UFunction>("/Script/FortniteGame.FortGadgetItemDefinition.GetDecoItemDefinition");
ItemDefinition->ProcessEvent(GetDecoItemDefinition, &ItemDefinition);
}
}
if (auto DecoItemDefinition = Cast<UFortDecoItemDefinition>(ItemDefinition)) if (auto DecoItemDefinition = Cast<UFortDecoItemDefinition>(ItemDefinition))
{ {
Pawn->PickUpActor(nullptr, DecoItemDefinition); // todo check ret value? Pawn->PickUpActor(nullptr, DecoItemDefinition); // todo check ret value?

View File

@@ -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::CompletePickupAnimation, (PVOID)AFortPickup::CompletePickupAnimationHook, (PVOID*)&AFortPickup::CompletePickupAnimationOriginal);
Hooking::MinHook::Hook((PVOID)Addresses::CanActivateAbility, ReturnTrueHook); // ahhh wtf Hooking::MinHook::Hook((PVOID)Addresses::CanActivateAbility, ReturnTrueHook); // ahhh wtf
// Hooking::MinHook::Hook((PVOID)FindFunctionCall(L"ServerRemoveInventoryItem"), UFortInventoryInterface::RemoveInventoryItemHook); // Hooking::MinHook::Hook((PVOID)FindFunctionCall(L"ServerRemoveInventoryItem"), UFortInventoryInterface::RemoveInventoryItemHook);
AddVehicleHook(); AddVehicleHook();
LOG_INFO(LogDev, "Test: 0x{:x}", FindFunctionCall(L"ClientOnPawnDied") - __int64(GetModuleHandleW(0))); 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); */ LOG_INFO(LogHook, "GetMaxTickRateIndex {}", GetMaxTickRateIndex); */
srand(time(0)); srand(time(0));
LOG_INFO(LogHook, "Finished!"); LOG_INFO(LogHook, "Finished!");

View File

@@ -4,7 +4,7 @@ namespace Globals
{ {
extern inline bool bCreative = false; extern inline bool bCreative = false;
extern inline bool bGoingToPlayEvent = false; extern inline bool bGoingToPlayEvent = false;
extern inline bool bNoMCP = false; extern inline bool bNoMCP = true;
extern inline bool bLateGame = false; extern inline bool bLateGame = false;
extern inline bool bAbilitiesEnabled = true; extern inline bool bAbilitiesEnabled = true;
} }

View File

@@ -43,8 +43,6 @@ inline void InitLogger()
FILE* stream = nullptr; FILE* stream = nullptr;
// bad but idk how to stop printing
freopen_s(&stream, "in.txt", "r", stdin); freopen_s(&stream, "in.txt", "r", stdin);
freopen_s(&stream, "out.txt", "w+", stdout); freopen_s(&stream, "out.txt", "w+", stdout);
freopen_s(&stream, "err.txt", "w", stderr); freopen_s(&stream, "err.txt", "w", stderr);