mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[MIRROR] fix return_inv() returning a null sometimes, causing get_all_gear() to runtime (#26421)
* fix return_inv() returning a null sometimes, causing get_all_gear() to runtime (#81344) ## About The Pull Request Fixes the return_inv() proc of datum/storage returning a null in addition to inventory items. This caused get_all_gear() proc of mob/living to runtime at times, because it would try to recursively access a null's inventory... ## Why It's Good For The Game Bugs bad. ## Changelog 🆑 fix: fix heretic's rust mark failing to damage any items if the victim has any container on them with another item inside, and maybe other bugs of similar nature /🆑 * fix return_inv() returning a null sometimes, causing get_all_gear() to runtime --------- Co-authored-by: ViktorKoL <44502667+ViktorKoL@users.noreply.github.com>
This commit is contained in:
@@ -605,12 +605,11 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
|
||||
*/
|
||||
/datum/storage/proc/return_inv(recursive = TRUE)
|
||||
var/list/ret = list()
|
||||
ret |= real_location.contents
|
||||
|
||||
for(var/atom/found_thing as anything in real_location)
|
||||
ret |= found_thing
|
||||
if(recursive)
|
||||
ret |= found_thing.atom_storage?.return_inv(ret, recursive = TRUE)
|
||||
if(recursive && found_thing.atom_storage)
|
||||
ret |= found_thing.atom_storage.return_inv(recursive = TRUE)
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user