mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
a bit
fix some bug with remvoing items, add experimental stat saving for gadgets, fix shadow stones scuffy
This commit is contained in:
@@ -1,11 +1,34 @@
|
||||
#include "FortItem.h"
|
||||
|
||||
#include "FortWeaponItemDefinition.h"
|
||||
#include "AbilitySystemComponent.h"
|
||||
|
||||
void FFortItemEntry::SetStateValue(EFortItemEntryState StateType, int IntValue)
|
||||
{
|
||||
for (int i = 0; i < GetStateValues().Num(); i++)
|
||||
{
|
||||
if (GetStateValues().at(i).GetStateType() == StateType)
|
||||
{
|
||||
GetStateValues().at(i).GetIntValue() = IntValue;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto idx = GetStateValues().AddUnitialized2(FFortItemEntryStateValue::GetStructSize());
|
||||
|
||||
GetStateValues().AtPtr(idx, FFortItemEntryStateValue::GetStructSize())->GetIntValue() = IntValue;
|
||||
GetStateValues().AtPtr(idx, FFortItemEntryStateValue::GetStructSize())->GetStateType() = StateType;
|
||||
GetStateValues().AtPtr(idx, FFortItemEntryStateValue::GetStructSize())->GetNameValue() = FName(0);
|
||||
|
||||
// idk some parentinventory stuff here
|
||||
|
||||
// ItemEntry->bIsDirty = true;
|
||||
}
|
||||
|
||||
FFortItemEntry* FFortItemEntry::MakeItemEntry(UFortItemDefinition* ItemDefinition, int Count, int LoadedAmmo, float Durability)
|
||||
{
|
||||
auto Entry = // (FFortItemEntry*)FMemory::Realloc(0, GetStructSize(), 0);
|
||||
Alloc<FFortItemEntry>(GetStructSize());
|
||||
bool bUseFMemoryRealloc = false; // I don't think this works because sometimes we don't free it (oops).
|
||||
auto Entry = Alloc<FFortItemEntry>(GetStructSize(), bUseFMemoryRealloc);
|
||||
|
||||
if (!Entry)
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user