From 25f5df4ba3e14aacdd1a97d5f6de51d3690cf3c2 Mon Sep 17 00:00:00 2001 From: FlimFlamm Date: Mon, 6 Feb 2017 22:04:33 -0400 Subject: [PATCH] This commit adds adjacency check, item-still-in-hands check, now properly handles null input, and consumes the crayon box upon completion. Everything compiles, and everything works on local environment. --- .../crates_lockers/closets/cardboardbox.dm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 21fb78c9eff..f5e0bd02819 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -66,15 +66,20 @@ qdel(src) return if(istype(W, /obj/item/weapon/storage/fancy/crayons)) /////addendum by flimflamm - var/decalselection = input("Please select a decal") in list( "cancel", "atmospherics", "bartender", "barber", "blueshield", "brig_physician", "captain", + var/decalselection = input("Please select a decal") as null|anything in list("atmospherics", "bartender", "barber", "blueshield", "brig_physician", "captain", "cargo", "chief_engineer", "chaplain", "chef", "chemist", "civilian", "clown", "cmo", "coroner", "detective", "engineering", "genetics", "hop", "hos", "hydroponics", "internal_affairs_agent", "janitor", "magistrate", "mechanic", "medical", "mime", "mining", "nt_representative", "paramedic", "pod_pilot", "prisoner", "research_director", "security", "syndicate", "therapist", "virology", "warden", "xenobiology") - if(decalselection == "cancel") + if(!decalselection) + return + if(user.incapacitated()) + return + if(W == user.get_active_hand() & src.Adjacent(usr)) + icon_opened = ("cardboard_open_"+decalselection) + icon_closed = ("cardboard_"+decalselection) + update_icon() // a proc declared in the closets parent file used to update opened/closed sprites on normal closets + qdel(W) return - icon_opened = ("cardboard_open_"+decalselection) - icon_closed = ("cardboard_"+decalselection) - update_icon() // a proc declared in the closets parent file used to update opened/closed sprites on normal closets - return - return \ No newline at end of file + return +