fix cheat god, fix 1.7.2, 1.8, 2.4.2, and probably 2.5, add rocket event idk couldnt test, fix some crashes.
This commit is contained in:
Milxnor
2023-04-25 18:22:59 -04:00
parent 358a2a9ef2
commit 93d18a3fe9
19 changed files with 180 additions and 40 deletions

View File

@@ -897,7 +897,9 @@ void AFortPlayerController::ServerAttemptInventoryDropHook(AFortPlayerController
if (!ItemDefinition || !ItemDefinition->CanBeDropped())
return;
if (!ItemDefinition->ShouldIgnoreRespawningOnDrop() && ItemDefinition->GetDropBehavior() != EWorldItemDropBehavior::DestroyOnDrop)
static auto DropBehaviorOffset = ItemDefinition->GetOffset("DropBehavior", false);
if (!ItemDefinition->ShouldIgnoreRespawningOnDrop() && (DropBehaviorOffset != -1 ? ItemDefinition->GetDropBehavior() != EWorldItemDropBehavior::DestroyOnDrop : true))
{
auto Pickup = AFortPickup::SpawnPickup(ReplicatedEntry, Pawn->GetActorLocation(),
EFortPickupSourceTypeFlag::Player, EFortPickupSpawnSource::Unset, Pawn);
@@ -923,6 +925,11 @@ void AFortPlayerController::ServerPlayEmoteItemHook(AFortPlayerController* Playe
if (!EmoteAsset || !PlayerState || !Pawn)
return;
auto AbilitySystemComponent = PlayerState->GetAbilitySystemComponent();
if (!AbilitySystemComponent)
return;
UObject* AbilityToUse = nullptr;
static auto AthenaSprayItemDefinitionClass = FindObject<UClass>("/Script/FortniteGame.AthenaSprayItemDefinition");
@@ -995,10 +1002,15 @@ void AFortPlayerController::ServerPlayEmoteItemHook(AFortPlayerController* Playe
FGameplayAbilitySpec* Spec = MakeNewSpec((UClass*)AbilityToUse, EmoteAsset, true);
if (!Spec)
return;
static unsigned int* (*GiveAbilityAndActivateOnce)(UAbilitySystemComponent* ASC, int* outHandle, __int64 Spec, FGameplayEventData* TriggerEventData) = decltype(GiveAbilityAndActivateOnce)(Addresses::GiveAbilityAndActivateOnce); // EventData is only on ue500?
if (GiveAbilityAndActivateOnce)
GiveAbilityAndActivateOnce(PlayerState->GetAbilitySystemComponent(), &outHandle, __int64(Spec), nullptr);
{
GiveAbilityAndActivateOnce(AbilitySystemComponent, &outHandle, __int64(Spec), nullptr);
}
}
uint8 ToDeathCause(const FGameplayTagContainer& TagContainer, bool bWasDBNO = false, AFortPawn* Pawn = nullptr)