Adminspawn-only proc call gun (#31732)

* Adminspawn-only proc call gun

* Can't forget this

* Let there be gunk

* Here too

* Here too

* This is nicer

* Less messy in some cases

* Should be this permission to be consistent

Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
kane-f
2022-01-11 01:01:55 +00:00
committed by GitHub
parent 97c678ea1b
commit 5d9af4cc30
8 changed files with 96 additions and 17 deletions

View File

@@ -1332,24 +1332,36 @@ var/global/floorIsLava = 0
var/chosen = filter_list_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
if(!chosen)
return
//preloader is hooked to atom/New(), and is automatically disabled once it 'loads' an object
_preloader.setup(varchanges, chosen)
if(ispath(chosen,/turf))
var/turf/T = get_turf(usr.loc)
T.ChangeTurf(chosen)
else if(ispath(chosen, /area))
var/area/A = locate(chosen)
var/turf/T = get_turf(usr.loc)
T.set_area(A)
else
new chosen(usr.loc)
var/atom/location = usr.loc
location.spawn_at(chosen, varchanges)
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// Helper functions for proc call madness
/atom/proc/spawn_at(var/type, var/list/varchanges = list())
if(!ispath(type))
return
//preloader is hooked to atom/New(), and is automatically disabled once it 'loads' an object
_preloader.setup(varchanges, type)
if(ispath(type,/turf))
var/turf/T = get_turf(src)
T.ChangeTurf(type)
else if(ispath(type, /area))
var/area/A = locate(type)
var/turf/T = get_turf(src)
T.set_area(A)
else
new type(src)
/atom/proc/spawn_at_turf(var/type, var/list/varchanges = list())
if(isarea(src))
return
var/turf/T = get_turf(src)
T.spawn_at(type,varchanges)
/datum/admins/proc/show_role_panel(var/mob/M in mob_list)
set category = "Admin"
set desc = "Edit mobs's Job, Roles, and Factions"