Made check less snowflakey

This commit is contained in:
warior4356
2020-11-08 23:20:23 -08:00
parent 18ceb59950
commit 673623d942
3 changed files with 11 additions and 7 deletions

View File

@@ -28,17 +28,17 @@
/obj/structure/closet/crate/can_close()
return TRUE
/obj/structure/closet/crate/open(irregular_open = FALSE)
/obj/structure/closet/crate/open(by_hand = FALSE)
if(src.opened)
return FALSE
if(!src.can_open())
return FALSE
if(!irregular_open)
if(by_hand)
for(var/obj/O in src)
if(O.density)
var/response = alert(usr, "This crate has been packed with bluespace compression, an item inside won't fit back inside. Are you sure you want to open it?","Bluespace Compression Warning", "No", "Yes")
if(response == "No")
if(response == "No" || !Adjacent(usr))
return FALSE
break
@@ -91,6 +91,10 @@
return
return ..()
/obj/structure/closet/crate/toggle(mob/user, by_hand = FALSE)
if(!(opened ? close() : open(by_hand)))
to_chat(user, "<span class='notice'>It won't budge!</span>")
/obj/structure/closet/crate/proc/try_rig(obj/item/W, mob/user)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
@@ -145,7 +149,7 @@
do_sparks(5, 1, src)
return
src.add_fingerprint(user)
src.toggle(user)
src.toggle(user, by_hand = TRUE)
// Called when a crate is delivered by MULE at a location, for notifying purposes
/obj/structure/closet/crate/proc/notifyRecipient(var/destination)
@@ -245,7 +249,7 @@
if(locked)
src.togglelock(user)
else
src.toggle(user)
src.toggle(user, by_hand = TRUE)
/obj/structure/closet/crate/secure/closed_item_click(mob/user)
togglelock(user)