This commit is contained in:
Gray
2024-01-15 12:17:34 -05:00
parent c0c37bf5ba
commit aacd99f4db
2 changed files with 7 additions and 4 deletions

View File

@@ -276,11 +276,12 @@ bool AFortInventory::RemoveItem(const FGuid& ItemGuid, bool* bShouldUpdate, int
auto& ItemInstances = GetItemList().GetItemInstances(); auto& ItemInstances = GetItemList().GetItemInstances();
auto& ReplicatedEntries = GetItemList().GetReplicatedEntries(); auto& ReplicatedEntries = GetItemList().GetReplicatedEntries();
auto OldItemCount = ReplicatedEntry->GetCount();
auto NewCount = ReplicatedEntry->GetCount() - Count; auto NewCount = ReplicatedEntry->GetCount() - Count;
bool bOverrideChangeStackSize = false; bool bOverrideChangeStackSize = false;
if (!bIgnoreVariables && ItemDefinition->ShouldPersistWhenFinalStackEmpty()) if (!bIgnoreVariables && ItemDefinition->ShouldPersistWhenFinalStackEmpty()) // idk this whole branch is brain damage and definitely doesnt work as intended
{ {
bool bIsFinalStack = true; bool bIsFinalStack = true;
@@ -297,8 +298,10 @@ bool AFortInventory::RemoveItem(const FGuid& ItemGuid, bool* bShouldUpdate, int
if (bIsFinalStack) if (bIsFinalStack)
{ {
NewCount = NewCount < 0 ? 0 : NewCount; // min(NewCount, 0) or something i forgot NewCount = NewCount < 0 ? 0 : NewCount; // min(NewCount, 0) or something i forgot // hm?
bOverrideChangeStackSize = true;
if (OldItemCount == 0) // hm?
bOverrideChangeStackSize = true;
} }
} }

View File

@@ -97,7 +97,7 @@ public:
return ReadBitfieldValue(bIgnoreRespawningForDroppingAsPickupOffset, bIgnoreRespawningForDroppingAsPickupFieldMask); return ReadBitfieldValue(bIgnoreRespawningForDroppingAsPickupOffset, bIgnoreRespawningForDroppingAsPickupFieldMask);
} }
bool ShouldPersistWhenFinalStackEmpty() bool ShouldPersistWhenFinalStackEmpty() // Used for Batman Grapnel
{ {
static auto bPersistInInventoryWhenFinalStackEmptyOffset = GetOffset("bPersistInInventoryWhenFinalStackEmpty", false); static auto bPersistInInventoryWhenFinalStackEmptyOffset = GetOffset("bPersistInInventoryWhenFinalStackEmpty", false);