Skip to content

Commit

Permalink
[FIX] Animated closet fixes (#27102)
Browse files Browse the repository at this point in the history
* Some animated closet fixes

* Trailing newline

---------

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
Adrer and [email protected] authored Oct 15, 2024
1 parent 0973879 commit 429bebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
8 changes: 5 additions & 3 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>")

0 comments on commit 429bebc

Please sign in to comment.