mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 19:13:30 +01:00
Made storage nesting better, improved consistency between storage types. (#24699)
* Made storage nesting better, improved consistency between storage types. * Out, er, space. * Null safety is good. * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
var/max_items = 7
|
||||
var/obj/item/storage/backpack/modstorage/bag
|
||||
|
||||
/obj/item/mod/module/storage/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_ADJACENCY_TRANSPARENT, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/mod/module/storage/serialize()
|
||||
var/list/data = ..()
|
||||
data["bag"] = bag.serialize()
|
||||
@@ -35,34 +39,24 @@
|
||||
bag.max_combined_w_class = max_combined_w_class
|
||||
bag.storage_slots = max_items
|
||||
bag.source = src
|
||||
bag.forceMove(src)
|
||||
|
||||
/obj/item/mod/module/storage/Destroy()
|
||||
QDEL_NULL(bag)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/mod/module/storage/on_install()
|
||||
mod.bag = bag
|
||||
bag.forceMove(mod)
|
||||
|
||||
/obj/item/mod/module/storage/on_uninstall(deleting = FALSE)
|
||||
if(!deleting)
|
||||
for(var/obj/I in bag.contents)
|
||||
I.forceMove(get_turf(loc))
|
||||
bag.forceMove(src)
|
||||
mod.bag = null
|
||||
return
|
||||
qdel(bag)
|
||||
UnregisterSignal(mod.chestplate, COMSIG_ITEM_PRE_UNEQUIP)
|
||||
|
||||
/obj/item/mod/module/storage/on_suit_deactivation(deleting)
|
||||
. = ..()
|
||||
bag.forceMove(src) //So the pinpointer doesnt lie.
|
||||
|
||||
/obj/item/mod/module/storage/on_unequip()
|
||||
. = ..()
|
||||
bag.forceMove(src)
|
||||
|
||||
/obj/item/mod/module/storage/large_capacity
|
||||
name = "MOD expanded storage module"
|
||||
desc = "Reverse engineered by Cybersun Industries from Donk Corporation designs, this system of hidden compartments \
|
||||
@@ -118,16 +112,6 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/backpack/modstorage/process()
|
||||
update_viewers()
|
||||
|
||||
/obj/item/storage/backpack/modstorage/update_viewers()
|
||||
for(var/_M in mobs_viewing)
|
||||
var/mob/M = _M
|
||||
if(!QDELETED(M) && M.s_active == src && (M in range(1, loc)) && (source.mod.loc == _M || (M in range(1, source.mod)))) //This ensures someone isn't taking it away from the mod unit
|
||||
continue
|
||||
hide_from(M)
|
||||
|
||||
|
||||
///Ion Jetpack - Lets the user fly freely through space using battery charge.
|
||||
/obj/item/mod/module/jetpack
|
||||
|
||||
Reference in New Issue
Block a user