Clean up some admin-transform related code (#40890)

1. there was an option for cancel when the input already had a cancel button
2. hitting either of these cancels did nothing, and it continued on with the
   transformation
3. there were some 1's and 0's that shoulda been TRUE and FALSE
This commit is contained in:
MrDoomBringer
2018-10-13 15:16:40 -04:00
committed by Tad Hardesty
parent f003c141e1
commit 33eef00d85
3 changed files with 6 additions and 7 deletions
+4 -2
View File
@@ -438,12 +438,12 @@
to_chat(usr, "This can only be used on instances of type /mob.")
return
var/delmob = 0
var/delmob = FALSE
switch(alert("Delete old mob?","Message","Yes","No","Cancel"))
if("Cancel")
return
if("Yes")
delmob = 1
delmob = TRUE
log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]].; deletemob=[delmob]")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]].; deletemob=[delmob]</span>")
@@ -464,6 +464,8 @@
M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob )
if("human")
var/posttransformoutfit = usr.client.robust_dress_shop()
if (!posttransformoutfit)
return
var/mob/living/carbon/human/newmob = M.change_mob_type( /mob/living/carbon/human , null, null, delmob )
if(posttransformoutfit && istype(newmob))
newmob.equipOutfit(posttransformoutfit)
+1 -4
View File
@@ -755,7 +755,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] changed the equipment of [ADMIN_LOOKUPFLW(H)] to [dresscode].</span>")
/client/proc/robust_dress_shop()
var/list/outfits = list("Cancel","Naked","Custom","As Job...")
var/list/outfits = list("Naked","Custom","As Job...")
var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job)
for(var/path in paths)
var/datum/outfit/O = path //not much to initalize here but whatever
@@ -769,9 +769,6 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if (outfits[dresscode])
dresscode = outfits[dresscode]
if(dresscode == "Cancel")
return
if (dresscode == "As Job...")
var/list/job_paths = subtypesof(/datum/outfit/job)
var/list/job_outfits = list()