Merge pull request #14804 from warior4356/crate-warning

Adds confirmation message to CC packed crates
This commit is contained in:
AffectedArc07
2020-11-16 08:30:45 +00:00
committed by GitHub
@@ -28,12 +28,20 @@
/obj/structure/closet/crate/can_close()
return TRUE
/obj/structure/closet/crate/open()
/obj/structure/closet/crate/open(by_hand = FALSE)
if(src.opened)
return FALSE
if(!src.can_open())
return FALSE
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" || !Adjacent(usr))
return FALSE
break
if(rigged && locate(/obj/item/radio/electropack) in src)
if(isliving(usr))
var/mob/living/L = usr
@@ -83,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
@@ -137,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)
@@ -237,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)