Adds specified give control option to mob VV (#48290)

* Adds specified give control option to VV

* click ckey to run

* Safer, less nullspacey.

* logging fixed

* review
This commit is contained in:
skoglol
2019-12-30 08:53:30 +01:00
committed by AnturK
parent eede5b77a2
commit 5de437ff1c
5 changed files with 43 additions and 7 deletions
+34 -5
View File
@@ -234,16 +234,45 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(M.ckey)
if(alert("This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes")
return
else
M.ghostize(FALSE)
if(!M || QDELETED(M))
to_chat(usr, "<span class='warning'>The target mob no longer exists.</span>")
return
message_admins("<span class='adminnotice'>[key_name_admin(usr)] assumed direct control of [M].</span>")
log_admin("[key_name(usr)] assumed direct control of [M].")
var/mob/adminmob = src.mob
M.ckey = src.ckey
if( isobserver(adminmob) )
var/mob/adminmob = mob
if(M.ckey)
M.ghostize(FALSE)
M.ckey = ckey
if(isobserver(adminmob))
qdel(adminmob)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Assume Direct Control") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_give_direct_control(mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Give direct control"
if(!M)
return
if(M.ckey)
if(alert("This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes")
return
var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sortList(GLOB.clients)
var/mob/oldmob = newkey.mob
var/delmob = FALSE
if((isobserver(oldmob) || alert("Do you want to delete [newkey]'s old mob?","Delete?","Yes","No") != "No"))
delmob = TRUE
if(!M || QDELETED(M))
to_chat(usr, "<span class='warning'>The target mob no longer exists, aborting.</span>")
return
if(M.ckey)
M.ghostize(FALSE)
M.ckey = newkey.key
if(delmob)
qdel(oldmob)
message_admins("<span class='adminnotice'>[key_name_admin(usr)] gave away direct control of [M] to [newkey].</span>")
log_admin("[key_name(usr)] gave away direct control of [M] to [newkey].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Give Direct Control") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_test_atmos_controllers()
set category = "Mapping"
set name = "Test Atmos Monitoring Consoles"
+1
View File
@@ -30,6 +30,7 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
/client/proc/count_objects_on_z_level,
/client/proc/count_objects_all,
/client/proc/cmd_assume_direct_control, //-errorage
/client/proc/cmd_give_direct_control,
/client/proc/startSinglo,
/client/proc/set_server_fps, //allows you to set the ticklag.
/client/proc/cmd_admin_grantfullaccess,