<feat: New project structure>

<feat: New release>
This commit is contained in:
Alessandro Autiero
2023-09-02 15:34:15 +02:00
parent 64b33102f4
commit b41e22adeb
953 changed files with 1373072 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#include "FortWeapon.h"
#include "FortPlayerPawn.h"
#include "reboot.h"
#include "FortPlayerController.h"
void AFortWeapon::OnPlayImpactFXHook(AFortWeapon* Weapon, __int64 HitResult, uint8_t ImpactPhysicalSurface, UObject* SpawnedPSC)
{
// grappler
auto Pawn = Cast<AFortPawn>(Weapon->GetOwner());
if (!Pawn)
return OnPlayImpactFXOriginal(Weapon, HitResult, ImpactPhysicalSurface, SpawnedPSC);
auto Controller = Cast<AFortPlayerController>(Pawn->GetController());
auto CurrentWeapon = Pawn->GetCurrentWeapon();
auto WorldInventory = Controller ? Controller->GetWorldInventory() : nullptr;
if (!WorldInventory || !CurrentWeapon)
return OnPlayImpactFXOriginal(Weapon, HitResult, ImpactPhysicalSurface, SpawnedPSC);
auto AmmoCount = CurrentWeapon->GetAmmoCount();
WorldInventory->CorrectLoadedAmmo(CurrentWeapon->GetItemEntryGuid(), AmmoCount);
return OnPlayImpactFXOriginal(Weapon, HitResult, ImpactPhysicalSurface, SpawnedPSC);
}
void AFortWeapon::ServerReleaseWeaponAbilityHook(UObject* Context, FFrame* Stack, void* Ret)
{
return ServerReleaseWeaponAbilityOriginal(Context, Stack, Ret);
}
UClass* AFortWeapon::StaticClass()
{
static auto Class = FindObject<UClass>(L"/Script/FortniteGame.FortWeapon");
return Class;
}