diff --git a/code/__DEFINES/equipment.dm b/code/__DEFINES/equipment.dm index bf7d10a6b96f..d95f22d4c6a5 100644 --- a/code/__DEFINES/equipment.dm +++ b/code/__DEFINES/equipment.dm @@ -526,19 +526,32 @@ GLOBAL_LIST_INIT(uniform_categories, list( // Storage flags -#define STORAGE_ALLOW_EMPTY (1<<0) // Whether the storage object has the 'empty' verb, which dumps all the contents on the floor -#define STORAGE_QUICK_EMPTY (1<<1) // Whether the storage object can quickly be emptied (no delay) -#define STORAGE_QUICK_GATHER (1<<2) // Whether the storage object can quickly collect all items from a tile via the 'toggle mode' verb -#define STORAGE_ALLOW_DRAWING_METHOD_TOGGLE (1<<3) // Whether this storage object can have its items drawn (pouches) -#define STORAGE_USING_DRAWING_METHOD (1<<4) // Whether this storage object has its items drawn (versus just opening it) -#define STORAGE_USING_FIFO_DRAWING (1<<5) // Wether the storage object can have items in it's leftmost slot be drawn -#define STORAGE_CLICK_EMPTY (1<<6) // Whether you can click to empty an item -#define STORAGE_CLICK_GATHER (1<<7) // Whether it is possible to use this storage object in an inverse way, - // so you can have the item in your hand and click items on the floor to pick them up -#define STORAGE_SHOW_FULLNESS (1<<8) // Whether our storage object on hud changes color when full -#define STORAGE_CONTENT_NUM_DISPLAY (1<<9) // Whether the storage object groups contents of the same type and displays them as a number. Only works for slot-based storage objects. -#define STORAGE_GATHER_SIMULTAENOUSLY (1<<10) // Whether the storage object can pick up all the items in a tile -#define STORAGE_ALLOW_QUICKDRAW (1<<11) // Whether the storage can be drawn with E or Holster verb +/// Whether the storage object has the 'empty' verb, which dumps all the contents on the floor +#define STORAGE_ALLOW_EMPTY (1<<0) +/// Whether the storage object can quickly be emptied (no delay) +#define STORAGE_QUICK_EMPTY (1<<1) +/// Whether the storage object can quickly collect all items from a tile via the 'toggle mode' verb +#define STORAGE_QUICK_GATHER (1<<2) +/// Whether this storage object can have its items drawn (pouches) +#define STORAGE_ALLOW_DRAWING_METHOD_TOGGLE (1<<3) +/// Whether this storage object has its items drawn (versus just opening it) +#define STORAGE_USING_DRAWING_METHOD (1<<4) +/// Wether the storage object can have items in it's leftmost slot be drawn +#define STORAGE_USING_FIFO_DRAWING (1<<5) +/// Whether you can click to empty an item +#define STORAGE_CLICK_EMPTY (1<<6) +/// Whether it is possible to use this storage object in an inverse way, so you can have the item in your hand and click items on the floor to pick them up +#define STORAGE_CLICK_GATHER (1<<7) +/// Whether our storage object on hud changes color when full +#define STORAGE_SHOW_FULLNESS (1<<8) +/// Whether the storage object groups contents of the same type and displays them as a number. Only works for slot-based storage objects. +#define STORAGE_CONTENT_NUM_DISPLAY (1<<9) +/// Whether the storage object can pick up all the items in a tile +#define STORAGE_GATHER_SIMULTAENOUSLY (1<<10) +/// Whether the storage can be drawn with E or Holster verb +#define STORAGE_ALLOW_QUICKDRAW (1<<11) +/// Whether using this item will try not to empty it if possible +#define STORAGE_DISABLE_USE_EMPTY (1<<12) #define STORAGE_FLAGS_DEFAULT (STORAGE_SHOW_FULLNESS|STORAGE_GATHER_SIMULTAENOUSLY|STORAGE_ALLOW_EMPTY) #define STORAGE_FLAGS_BOX (STORAGE_FLAGS_DEFAULT) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index 6db0d5c550bd..06e1fa4ab3ab 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -303,6 +303,7 @@ DEFINE_BITFIELD(storage_flags, list( "STORAGE_CONTENT_NUM_DISPLAY" = STORAGE_CONTENT_NUM_DISPLAY, "STORAGE_GATHER_SIMULTAENOUSLY" = STORAGE_GATHER_SIMULTAENOUSLY, "STORAGE_ALLOW_QUICKDRAW" = STORAGE_ALLOW_QUICKDRAW, + "STORAGE_DISABLE_USE_EMPTY" = STORAGE_DISABLE_USE_EMPTY, )) DEFINE_BITFIELD(datum_flags, list( diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index a684586675a6..4ea6bf85a5eb 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -345,7 +345,7 @@ /obj/item/toy/dice, /obj/item/paper, ) - storage_flags = STORAGE_FLAGS_BOX|STORAGE_CLICK_GATHER|STORAGE_QUICK_GATHER + storage_flags = STORAGE_FLAGS_BOX|STORAGE_CLICK_GATHER|STORAGE_QUICK_GATHER|STORAGE_DISABLE_USE_EMPTY storage_slots = null use_sound = "pillbottle" max_storage_space = 16 @@ -759,7 +759,7 @@ max_w_class = 0 max_storage_space = 4 skilllock = SKILL_MEDICAL_DEFAULT - storage_flags = STORAGE_FLAGS_BOX + storage_flags = STORAGE_FLAGS_BOX|STORAGE_DISABLE_USE_EMPTY display_maptext = FALSE /obj/item/storage/pill_bottle/packet/Initialize() diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index c04de364baf7..1e1d12760cab 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -857,7 +857,8 @@ W is always an item. stop_warning prevents messaging. user may be null.**/ //Clicking on itself will empty it, if it has contents and the verb to do that. Contents but no verb means nothing happens. if(length(contents)) - empty(user) + if (!(storage_flags & STORAGE_DISABLE_USE_EMPTY)) + empty(user) return //Otherwise we'll try to fold it.