Added Inventory UNCLEARABLE flag.

- Allows prevention of ClearInventory without stopping it from being dropped.
This commit is contained in:
Major Cooke 2019-02-01 11:07:36 -06:00 committed by Christoph Oelckers
parent 5e9001e7bc
commit 695eced81a
3 changed files with 3 additions and 2 deletions

View file

@ -336,7 +336,7 @@ extend class Actor
while (last.inv != NULL)
{
let inv = last.inv;
if (!inv.bUndroppable)
if (!inv.bUndroppable && !inv.bUnclearable)
{
inv.DepleteOrDestroy();
if (!inv.bDestroyed) last = inv; // was only depleted so advance the pointer manually.

View file

@ -64,6 +64,7 @@ class Inventory : Actor
flagdef IsArmor: ItemFlags, 21;
flagdef IsHealth: ItemFlags, 22;
flagdef AlwaysPickup: ItemFlags, 23;
flagdef Unclearable: ItemFlags, 24;
flagdef ForceRespawnInSurvival: none, 0;
flagdef PickupFlash: none, 6;

View file

@ -2042,7 +2042,7 @@ class PlayerPawn : Actor
if (item.bINVBAR && item.Amount > item.InterHubAmount)
{
item.Amount = item.InterHubAmount;
if (level.REMOVEITEMS && !item.bUNDROPPABLE)
if (level.REMOVEITEMS && !item.bUNDROPPABLE && !item.bUNCLEARABLE)
{
todelete.Push(item);
}