[FIX] Animated closet fixes (#27102)

* Some animated closet fixes

* Trailing newline

---------

Co-authored-by: adrermail@gmail.com <adrermail@gmail.com>
This commit is contained in:
Chap
2024-10-15 03:09:04 +02:00
committed by GitHub
parent 0973879763
commit 429bebc613
2 changed files with 9 additions and 19 deletions
@@ -524,13 +524,15 @@
for(var/atom/A in location)
if(A.density && A != src && A != AM)
transparent = TRUE
break
alpha = 180
update_icon()
return
alpha = 255
update_icon()
/obj/structure/closet/bluespace/Crossed(atom/movable/AM, oldloc)
if(AM.density)
transparent = TRUE
update_icon()
UpdateTransparency(location = loc)
/obj/structure/closet/bluespace/Move(NewLoc, direct) // Allows for "phasing" throug objects but doesn't allow you to stuff your EOC homebois in one of these and push them through walls.
var/turf/T = get_turf(NewLoc)
@@ -39,10 +39,6 @@
if(opened || !istype(W, /obj/item/card/id))
return ..()
if(broken)
to_chat(user, "<span class='warning'>It appears to be broken.</span>")
return
if(istype(W, /obj/item/card/id/guest))
to_chat(user, "<span class='warning'>Invalid identification card.</span>")
return
@@ -51,24 +47,16 @@
if(!I || !I.registered_name)
return
if(src == user.loc)
to_chat(user, "<span class='notice'>You can't reach the lock from inside.</span>")
else if(allowed(user) || !registered_name || (istype(I) && (registered_name == I.registered_name)))
cut_overlays()
//they can open all lockers, or nobody owns this, or they own this locker
locked = !locked
if(locked)
add_overlay("locked")
else
add_overlay("unlocked")
icon_state = icon_closed
togglelock(user)
if(!locked)
registered_name = null
desc = initial(desc)
if(!registered_name && locked)
registered_name = I.registered_name
desc = "Owned by [I.registered_name]."
desc = "Owned by [I.registered_name]."
else
to_chat(user, "<span class='warning'>Access denied.</span>")