Closes UI for all players looking into a storage inside a recently closed locker (#17519)

* Close UI for all players looking into a storage inside a locker

* Moves the check to objects/item/weapons/storage

Also removed the code from objects\structures\crates_lockers\closets.dm

* Keeps UI open for the mob itself, when they should

Also removed code from attack_hand that conflicted with forceMove. That behaviour is being handled from the forceMove instead of from attack_hand.
This commit is contained in:
Nazsgull
2022-04-22 11:42:58 +01:00
committed by GitHub
parent 2eac53c340
commit c3013b83ca
@@ -85,6 +85,14 @@
LAZYCLEARLIST(mobs_viewing)
return ..()
/obj/item/storage/forceMove(atom/destination)
. = ..()
if(!ismob(destination.loc))
for(var/mob/player in mobs_viewing)
if(player == destination)
continue
hide_from(player)
/obj/item/storage/MouseDrop(obj/over_object)
if(!ismob(usr)) //so monkeys can take off their backpacks -- Urist
return
@@ -532,9 +540,6 @@
show_to(user)
else
..()
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
add_fingerprint(user)
/obj/item/storage/equipped(mob/user, slot, initial)