Merge pull request #26907 from Cyberboss/FixProcCalling

Revert "Allows admins to pass parameters to New()"
This commit is contained in:
oranges
2017-05-05 11:38:40 +12:00
committed by GitHub
5 changed files with 8 additions and 61 deletions

View File

@@ -488,15 +488,3 @@
L1[key] += other_value
else
L1[key] = other_value
/proc/print_single_line(list/L)
. = "list("
for(var/I in 1 to L.len)
var/key = L[I]
. += "[key]"
var/val = L[key]
if(!isnull(val))
. += " => [val]"
if(I < L.len)
. += ", "
. += ")"

View File

@@ -610,41 +610,20 @@
set desc = "(atom path) Spawn an atom"
set name = "Spawn"
return usr.client.spawn_atom_impl(object, FALSE)
/datum/admins/proc/spawn_atom_adv(object as text)
set category = "Debug"
set desc = "(atom path) Spawn an atom with New() parameters"
set name = "Advanced Spawn"
return usr.client.spawn_atom_impl(object, TRUE)
/client/proc/spawn_atom_impl(object, params)
if(!check_rights(R_SPAWN))
return
var/chosen = pick_closest_path(object)
if(!chosen)
return
var/list/arguments
if(ispath(chosen,/turf))
var/turf/T = get_turf(usr.loc)
T.ChangeTurf(chosen)
else
if(params)
arguments = usr.client.get_callproc_args(TRUE)
if(!usr)
return
arguments = list(usr.loc) + arguments
var/atom/A = new chosen(arglist(arguments))
var/atom/A = new chosen(usr.loc)
A.admin_spawned = TRUE
log_admin("[key_name(usr)] spawned [chosen] at [COORD(usr)][LAZYLEN(arguments) > 1 ? " with parameters [print_single_line(arguments)]": ""]")
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
SSblackbox.add_details("admin_verb","Spawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -101,7 +101,7 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list(
/client/proc/smite
))
GLOBAL_PROTECT(admin_verbs_spawn)
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom,/datum/admins/proc/spawn_atom_adv,/client/proc/respawn_character))
GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom,/client/proc/respawn_character))
GLOBAL_PROTECT(admin_verbs_server)
GLOBAL_LIST_INIT(admin_verbs_server, world.AVerbsServer())
/world/proc/AVerbsServer()

View File

@@ -145,8 +145,8 @@ GLOBAL_PROTECT(AdminProcCallCount)
/client/proc/get_callproc_args(is_atom_new = FALSE)
var/argnum = input("Number of arguments[is_atom_new ? " (Excluding loc)" : ""]","Number:",0) as num|null
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null
if(isnull(argnum))
return

View File

@@ -213,14 +213,7 @@ GLOBAL_PROTECT(VVpixelmovement)
.["class"] = null
return
.["type"] = type
var/list/arguments
if(alert(usr, "Would you like to add arguments?", "New Atom", "No", "Yes") == "Yes")
arguments = get_callproc_args(FALSE)
else
arguments = list()
.["value"] = new type(arglist(arguments))
.["value"] = new type()
if (VV_NEW_DATUM)
var/type = pick_closest_path(FALSE, get_fancy_list_of_datum_types())
@@ -228,13 +221,7 @@ GLOBAL_PROTECT(VVpixelmovement)
.["class"] = null
return
.["type"] = type
var/list/arguments
if(alert(usr, "Would you like to add arguments?", "New Atom", "No", "Yes") == "Yes")
arguments = get_callproc_args(FALSE)
else
arguments = list()
.["value"] = new type(arglist(arguments))
.["value"] = new type()
if (VV_NEW_TYPE)
var/type = current_value
@@ -250,14 +237,7 @@ GLOBAL_PROTECT(VVpixelmovement)
.["class"] = null
return
.["type"] = type
var/list/arguments
if(alert(usr, "Would you like to add arguments?", "New Atom", "No", "Yes") == "Yes")
arguments = get_callproc_args(FALSE);
else
arguments = list()
.["value"] = new type(arglist(arguments))
.["value"] = new type()
if (VV_NEW_LIST)