mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 02:57:48 +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:
@@ -23,14 +23,14 @@
|
||||
)
|
||||
|
||||
/obj/item/storage/backpack/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(in_range(user, src))
|
||||
playsound(src.loc, "rustle", 50, 1, -5)
|
||||
if(Adjacent(user))
|
||||
playsound(src.loc, "rustle", 50, TRUE, -5)
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/backpack/examine(mob/user)
|
||||
var/space_used = 0
|
||||
. = ..()
|
||||
if(in_range(user, src))
|
||||
if(Adjacent(user))
|
||||
for(var/obj/item/I in contents)
|
||||
space_used += I.w_class
|
||||
if(!space_used)
|
||||
|
||||
@@ -73,6 +73,8 @@
|
||||
closer.plane = ABOVE_HUD_PLANE
|
||||
orient2hud()
|
||||
|
||||
ADD_TRAIT(src, TRAIT_ADJACENCY_TRANSPARENT, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/storage/Destroy()
|
||||
for(var/obj/O in contents)
|
||||
O.mouse_opacity = initial(O.mouse_opacity)
|
||||
@@ -232,9 +234,15 @@
|
||||
/obj/item/storage/proc/update_viewers()
|
||||
for(var/_M in mobs_viewing)
|
||||
var/mob/M = _M
|
||||
if(!QDELETED(M) && M.s_active == src && (M in range(1, loc)))
|
||||
if(!QDELETED(M) && M.s_active == src && Adjacent(M))
|
||||
continue
|
||||
hide_from(M)
|
||||
for(var/obj/item/storage/child in src)
|
||||
child.update_viewers()
|
||||
|
||||
/obj/item/storage/Moved(atom/oldloc, dir, forced = FALSE)
|
||||
. = ..()
|
||||
update_viewers()
|
||||
|
||||
/obj/item/storage/proc/open(mob/user)
|
||||
if(use_sound && isliving(user))
|
||||
|
||||
Reference in New Issue
Block a user