Being abducted by a contractor no longer recursively dumps contents of all of your boxes and belts, nor does it break your UI anymore (#86657)

## About The Pull Request

Contractor abductions no longer recursively dump all of your items on
the ground, instead only doing a single depth loop. Also fixed storage
UI getting broken after being kidnapped due to using a wrong proc

## Why It's Good For The Game

There's zero reason as for why it should behave like that other than
just making recovery far more annoying.

## Changelog
🆑
fix: Your UI no longer breaks after being kidnapped by a contractor
qol: Being kidnapped by a contractor no longer dumps all of your boxes
and belts
/🆑
This commit is contained in:
SmArtKar
2024-09-16 09:19:50 -04:00
committed by GitHub
parent 686a1d3286
commit cfa8bf43a8
3 changed files with 13 additions and 9 deletions
+5 -5
View File
@@ -586,19 +586,19 @@
hud_used.build_hand_slots()
//GetAllContents that is reasonable and not stupid
/mob/living/proc/get_all_gear()
var/list/processing_list = get_equipped_items(INCLUDE_POCKETS | INCLUDE_ACCESSORIES | INCLUDE_HELD)
/mob/living/proc/get_all_gear(accessories = TRUE, recursive = TRUE)
var/list/processing_list = get_equipped_items(INCLUDE_POCKETS | INCLUDE_HELD | (accessories ? INCLUDE_ACCESSORIES : NONE))
list_clear_nulls(processing_list) // handles empty hands
var/i = 0
while(i < length(processing_list))
var/atom/A = processing_list[++i]
if(A.atom_storage)
if(A.atom_storage && recursive)
processing_list += A.atom_storage.return_inv()
return processing_list
/// Returns a list of things that the provided mob has, including any storage-capable implants.
/mob/living/proc/gather_belongings()
var/list/belongings = get_all_gear()
/mob/living/proc/gather_belongings(accessories = TRUE, recursive = TRUE)
var/list/belongings = get_all_gear(accessories, recursive)
for (var/obj/item/implant/storage/internal_bag in implants)
belongings += internal_bag.contents
return belongings