mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
41 lines
944 B
C++
41 lines
944 B
C++
#include "FortWeaponItemDefinition.h"
|
|
|
|
#include "DataTable.h"
|
|
|
|
int UFortWeaponItemDefinition::GetClipSize()
|
|
{
|
|
static auto WeaponStatHandleOffset = GetOffset("WeaponStatHandle");
|
|
auto& WeaponStatHandle = Get<FDataTableRowHandle>(WeaponStatHandleOffset);
|
|
|
|
auto Table = WeaponStatHandle.DataTable;
|
|
|
|
if (!Table)
|
|
return 0;
|
|
|
|
auto& RowMap = Table->GetRowMap();
|
|
|
|
void* Row = nullptr;
|
|
|
|
for (int i = 0; i < RowMap.Pairs.Elements.Data.Num(); i++)
|
|
{
|
|
auto& Pair = RowMap.Pairs.Elements.Data.at(i).ElementData.Value;
|
|
|
|
if (Pair.Key() == WeaponStatHandle.RowName)
|
|
{
|
|
Row = Pair.Value();
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!Row)
|
|
return 0;
|
|
|
|
static auto ClipSizeOffset = FindOffsetStruct("/Script/FortniteGame.FortBaseWeaponStats", "ClipSize");
|
|
return *(int*)(__int64(Row) + ClipSizeOffset);
|
|
}
|
|
|
|
UClass* UFortWeaponItemDefinition::StaticClass()
|
|
{
|
|
static auto Class = FindObject<UClass>(L"/Script/FortniteGame.FortWeaponItemDefinition");
|
|
return Class;
|
|
} |