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 12:16:40 -07: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()
@@ -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, "<span class='danger'>Cannot convert players who have not entered yet.</span>")