From 0cdf3a0d125031c2c415aaabe78c59d690878f74 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Mon, 15 Feb 2021 10:38:36 +0000 Subject: [PATCH] 'Send Mob' cancel button (#15499) --- code/modules/admin/verbs/adminjump.dm | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 0a36b18dd26..7fe4438322a 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -161,22 +161,24 @@ admin_forcemove(usr, M.loc) SSblackbox.record_feedback("tally", "admin_verb", 1, "Get Key") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/sendmob(var/mob/M in GLOB.mob_list) +/client/proc/sendmob(mob/M in GLOB.mob_list) set category = "Admin" set name = "Send Mob" if(!check_rights(R_ADMIN)) return - var/area/A = input(usr, "Pick an area.", "Pick an area") in return_sorted_areas() - if(A) - if(isobj(M.loc)) - var/obj/O = M.loc - O.force_eject_occupant(M) - admin_forcemove(M, pick(get_area_turfs(A))) - SSblackbox.record_feedback("tally", "admin_verb", 1, "Send Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(usr)] teleported [key_name(M)] to [A]") - message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]", 1) + var/area/A = input(usr, "Pick an area.", "Pick an area") as null|anything in return_sorted_areas() + if(!A) + return + + if(isobj(M.loc)) + var/obj/O = M.loc + O.force_eject_occupant(M) + admin_forcemove(M, pick(get_area_turfs(A))) + SSblackbox.record_feedback("tally", "admin_verb", 1, "Send Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + log_admin("[key_name(usr)] teleported [key_name(M)] to [A]") + message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]", 1) /proc/admin_forcemove(mob/mover, atom/newloc) mover.forceMove(newloc)