Files
Project-Reboot-3.0/Project Reboot 3.0/FortGadgetItemDefinition.cpp
Milxnor f49f166c2d great
pickup combining, almost finish shadow stones, fix some bugs with gadgets, clean up some code.
2023-05-02 23:48:05 -04:00

32 lines
1.4 KiB
C++

#include "FortGadgetItemDefinition.h"
#include "FortAbilitySet.h"
#include "SoftObjectPath.h"
#include "FortPlayerStateAthena.h"
#include "addresses.h"
#include "FortPlayerPawnAthena.h"
#include "FortPlayerControllerAthena.h"
void UFortGadgetItemDefinition::UnequipGadgetData(AFortPlayerController* PlayerController, UFortItem* Item)
{
static auto FortInventoryOwnerInterfaceClass = FindObject<UClass>("/Script/FortniteGame.FortInventoryOwnerInterface");
__int64 (*RemoveGadgetDataOriginal)(UFortGadgetItemDefinition* a1, __int64 a2, UFortItem* a3) = decltype(RemoveGadgetDataOriginal)(Addresses::RemoveGadgetData);
RemoveGadgetDataOriginal(this, __int64(PlayerController->GetInterfaceAddress(FortInventoryOwnerInterfaceClass)), Item);
if (auto CosmeticLoadoutPC = PlayerController->GetCosmeticLoadout())
{
if (auto CharacterToApply = CosmeticLoadoutPC->GetCharacter())
{
ApplyCID(Cast<AFortPlayerPawn>(PlayerController->GetMyFortPawn()), CharacterToApply); // idk why no automatic
}
}
}
void UFortGadgetItemDefinition::UpdateTrackedAttributesHook(UFortGadgetItemDefinition* GadgetItemDefinition)
{
// LOG_INFO(LogDev, "UpdateTrackedAttributesHook Return: 0x{:x}", __int64(_ReturnAddress()) - __int64(GetModuleHandleW(0)));
if (GadgetItemDefinition->ShouldDestroyGadgetWhenTrackedAttributesIsZero())
{
// PlayerState->MulticastTriggerOnGadgetTrackedAttributeDestroyedFX
}
}