From 695eced81a91e6a4166efa5f07020a2ef33f6cb6 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Fri, 1 Feb 2019 11:07:36 -0600 Subject: [PATCH] Added Inventory UNCLEARABLE flag. - Allows prevention of ClearInventory without stopping it from being dropped. --- wadsrc/static/zscript/actor_inventory.txt | 2 +- wadsrc/static/zscript/inventory/inventory.txt | 1 + wadsrc/static/zscript/shared/player.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/actor_inventory.txt b/wadsrc/static/zscript/actor_inventory.txt index 8fc3c6d5c..837184dd1 100644 --- a/wadsrc/static/zscript/actor_inventory.txt +++ b/wadsrc/static/zscript/actor_inventory.txt @@ -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. diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index f89bb7493..9c977d36b 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -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; diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index cdcfccf13..3e3bd2e56 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -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); }