fix 16.50, fix failing abilities s16+, ammo in bottom right

This commit is contained in:
Milxnor
2023-04-02 11:58:32 -04:00
parent 3bca6f76fe
commit 20e9fb87df
9 changed files with 106 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
#include "FortPawn.h"
#include "reboot.h"
#include "FortPlayerControllerAthena.h"
AFortWeapon* AFortPawn::EquipWeaponDefinition(UFortWeaponItemDefinition* WeaponData, const FGuid& ItemEntryGuid)
{
@@ -56,6 +57,24 @@ void AFortPawn::SetShield(float NewShield)
this->ProcessEvent(SetShieldFn, &NewShield);
}
void AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook(UObject* Context, FFrame* Stack, void* Ret)
{
auto Pawn = (AFortPawn*)Context;
auto Controller = Cast<AFortPlayerController>(Pawn->GetController());
auto CurrentWeapon = Pawn->GetCurrentWeapon();
auto WorldInventory = Controller ? Controller->GetWorldInventory() : nullptr;
if (!WorldInventory || !CurrentWeapon)
return NetMulticast_Athena_BatchedDamageCuesOriginal(Context, Stack, Ret);
static auto AmmoCountOffset = CurrentWeapon->GetOffset("AmmoCount");
auto AmmoCount = CurrentWeapon->Get<int>(AmmoCountOffset);
WorldInventory->CorrectLoadedAmmo(CurrentWeapon->GetItemEntryGuid(), AmmoCount);
return NetMulticast_Athena_BatchedDamageCuesOriginal(Context, Stack, Ret);
}
UClass* AFortPawn::StaticClass()
{
static auto Class = FindObject<UClass>("/Script/FortniteGame.FortPawn");