Fix lockers giving no feedback when trying to close them with another locker inside (#69172)

Fix lockers giving no feedback when trying to close them with another locker inside

You also no longer try to toggle the lock status when you fail to close an open locker. I think this was a bit weird behaviour because changing the lock status of an open locker doesn't really make sense and only resulted in confusing messages.
This commit is contained in:
Vincent
2022-08-22 17:46:36 +02:00
committed by GitHub
parent 04c36e57f0
commit 4a98864d30
@@ -220,6 +220,8 @@
var/turf/T = get_turf(src)
for(var/obj/structure/closet/closet in T)
if(closet != src && !closet.wall_mounted)
if(user)
balloon_alert(user, "another closet is in the way!")
return FALSE
for(var/mob/living/L in T)
if(L.anchored || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
@@ -458,7 +460,7 @@
var/item_is_id = W.GetID()
if(!item_is_id)
return FALSE
if(item_is_id || !toggle(user))
if((item_is_id || !toggle(user)) && !opened)
togglelock(user)
else
return FALSE
@@ -538,9 +540,11 @@
if(user.body_position == LYING_DOWN && get_dist(src, user) > 0)
return
if(!toggle(user))
togglelock(user)
if(toggle(user))
return
if(!opened)
togglelock(user)
/obj/structure/closet/attack_paw(mob/user, list/modifiers)
return attack_hand(user, modifiers)