mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00:00
Spawn QOL
This commit is contained in:
@@ -1273,12 +1273,22 @@ var/global/floorIsLava = 0
|
||||
*/
|
||||
/datum/admins/proc/spawn_atom(var/object as text)
|
||||
set category = "Debug"
|
||||
set desc = "(atom path) Spawn an atom. Finish path with a period to hide subtypes"
|
||||
set desc = "(atom path) Spawn an atom. Finish path with a period to hide subtypes, include any variable changes at the end like so: {name=\"Test\";amount=50}"
|
||||
set name = "Spawn"
|
||||
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
//Parse and strip any changed variables (added in curly brackets at the end of the input string)
|
||||
var/variables_start = findtext(object,"{")
|
||||
|
||||
var/list/varchanges = list()
|
||||
if(variables_start)
|
||||
var/parameters = copytext(object,variables_start+1,length(object))//removing the last '}'
|
||||
varchanges = readlist(parameters, ";")
|
||||
|
||||
object = copytext(object, 1, variables_start)
|
||||
|
||||
var/list/matches = get_matching_types(object, /atom)
|
||||
|
||||
if(matches.len==0)
|
||||
@@ -1292,6 +1302,8 @@ var/global/floorIsLava = 0
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
_preloader = new(varchanges, chosen)
|
||||
|
||||
if(ispath(chosen,/turf))
|
||||
var/turf/T = get_turf(usr.loc)
|
||||
T.ChangeTurf(chosen)
|
||||
|
||||
Reference in New Issue
Block a user