diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm index 4d1de50e472..a3b7e4247c1 100644 --- a/code/modules/admin/verbs/manipulate_organs.dm +++ b/code/modules/admin/verbs/manipulate_organs.dm @@ -1,7 +1,9 @@ /client/proc/manipulate_organs(mob/living/carbon/C in world) set name = "Manipulate Organs" set category = "Debug" - var/operation = input("Select organ operation.", "Organ Manipulation", "cancel") in list("add organ", "add implant", "drop organ/implant", "remove organ/implant", "cancel") + var/operation = input("Select organ operation.", "Organ Manipulation", "cancel") as null|anything in list("add organ", "add implant", "drop organ/implant", "remove organ/implant", "cancel") + if (!operation) + return var/list/organs = list() switch(operation) @@ -10,7 +12,9 @@ var/dat = replacetext("[path]", "/obj/item/organ/", ":") organs[dat] = path - var/obj/item/organ/organ = input("Select organ type:", "Organ Manipulation", null) in organs + var/obj/item/organ/organ = input("Select organ type:", "Organ Manipulation", null) as null|anything in organs + if(!organ) + return organ = organs[organ] organ = new organ organ.Insert(C) @@ -22,7 +26,9 @@ var/dat = replacetext("[path]", "/obj/item/implant/", ":") organs[dat] = path - var/obj/item/implant/organ = input("Select implant type:", "Organ Manipulation", null) in organs + var/obj/item/implant/organ = input("Select implant type:", "Organ Manipulation", null) as null|anything in organs + if(!organ) + return organ = organs[organ] organ = new organ organ.implant(C) @@ -38,7 +44,9 @@ var/obj/item/implant/I = X organs["[I.name] ([I.type])"] = I - var/obj/item/organ = input("Select organ/implant:", "Organ Manipulation", null) in organs + var/obj/item/organ = input("Select organ/implant:", "Organ Manipulation", null) as null|anything in organs + if(!organ) + return organ = organs[organ] if(!organ) return