Allow cancelling partway through Manipulate Organs (#38471)

This commit is contained in:
Tad Hardesty
2018-06-14 14:12:26 -07:00
committed by ShizCalev
parent a70f6f1461
commit a994ac5bc5
+12 -4
View File
@@ -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