From 33eef00d85a8348fb693d4d602c6c660e4fd6f4d Mon Sep 17 00:00:00 2001 From: MrDoomBringer Date: Sat, 13 Oct 2018 15:16:40 -0400 Subject: [PATCH] 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 --- code/modules/admin/topic.dm | 6 ++++-- code/modules/admin/verbs/debug.dm | 5 +---- code/modules/mob/mob_transformation_simple.dm | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index d841b0dc275..12a6c639868 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -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("[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]].; deletemob=[delmob]") @@ -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) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 67b33afcc6f..b3691bc4e10 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -755,7 +755,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) message_admins("[key_name_admin(usr)] changed the equipment of [ADMIN_LOOKUPFLW(H)] to [dresscode].") /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() diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index f53287ee6b5..9f2970a6e31 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -2,7 +2,7 @@ //This proc is the most basic of the procs. All it does is make a new mob on the same tile and transfer over a few variables. //Returns the new mob //Note that this proc does NOT do MMI related stuff! -/mob/proc/change_mob_type(new_type = null, turf/location = null, new_name = null as text, delete_old_mob = 0 as num) +/mob/proc/change_mob_type(new_type = null, turf/location = null, new_name = null as text, delete_old_mob = FALSE) if(isnewplayer(src)) to_chat(usr, "Cannot convert players who have not entered yet.")