Removes eye color vars on the human, stores it on the eyes

Also adds a proc nifty for SDQL fans, which grants greater control over
spawning atoms.

Also fixes deserialization to make hair show up again
This commit is contained in:
Crazylemon64
2016-08-13 23:05:32 -07:00
parent dbfc4562fa
commit 3ca5a1f3f7
21 changed files with 212 additions and 169 deletions
@@ -0,0 +1,29 @@
// This one's for you, SDQL fans
// Give this a string and a location to create the object. Examples of functioning
// strings for this function:
/*
{"type":"/obj/item/weapon/crowbar", "color":"#FF0000","force":5000,"name":"Greytide's Gravedigger"}
*/
// This is a bit more flexible than the serialization interface because that interface
// expects a rigid structure for the data
/proc/json_to_object_arbitrary_vars(json_data, position)
var/data = json_decode(json_data)
return list_to_object_arbitrary_vars(data, position)
/proc/list_to_object_arbitrary_vars(list/data, position)
if(!islist(data))
throw EXCEPTION("Not a list.")
if(!("type" in data))
throw EXCEPTION("No 'type' field in the data")
var/path = text2path(data["type"])
if(!path)
throw EXCEPTION("Path not found: [path]")
var/atom/movable/thing = new path(position)
data -= "type"
for(var/attribute in data)
thing.vars[attribute] = data[attribute]
return thing