This commit is contained in:
kevinz000
2017-05-14 20:19:26 -07:00
parent e7c41603f0
commit da615b1440
4 changed files with 15 additions and 4 deletions
+6 -3
View File
@@ -10,7 +10,9 @@
/proc/handle_roundstart_items(mob/living/M)
world << "handle_roundstart_items([M])"
if(!istype(M) || !M.ckey || !M.mind)
world << "handle_roundstart_items: [M] has either no ckey or no mind!"
world << "handle_roundstart_items: [M] has either no ckey or no mind!"
if(!M.mind)
world << "[M] has no mind!"
return FALSE
var/list/items = parse_custom_items_by_key_and_job(M.ckey, M.mind.assigned_role)
if(M.mind.special_role)
@@ -52,8 +54,9 @@
return FALSE
var/turf/T = get_turf(H)
for(var/item in itemlist)
if(!ispath(item))
item = text2path(item)
var/path = item
if(!ispath(path))
path = text2path(path)
if(!path)
continue
var/amount = itemlist[item]
@@ -24,6 +24,8 @@ GLOBAL_LIST(custom_item_list)
var/ckey_str = ckey(copytext(line, 1, ckey_str_sep))
var/job_str = copytext(line, ckey_str_sep+1, job_str_sep)
var/item_str = copytext(line, job_str_sep+1, item_str_sep)
if(!ckey_str || !job_str || !item_str || !length(ckey_str) || length(job_str) || length(item_str))
throw EXCEPTION("Errored Line")
world << "DEBUG: Line process: [line]"
world << "DEBUG: [ckey_str_sep], [job_str_sep], [item_str_sep], [ckey_str], [job_str], [item_str]."
if(!islist(GLOB.custom_item_list[ckey_str]))
@@ -40,10 +42,13 @@ GLOBAL_LIST(custom_item_list)
var/path = copytext(item_string, 1, path_str_sep) //Path to spawn
var/amount = copytext(item_string, path_str_sep+1) //Amount to spawn
world << "DEBUG: Item string [item_string] processed"
amount = text2num(amount)
path = text2path(path)
if(!ispath(path) || !isnum(amount))
throw EXCEPTION("Errored line")
world << "DEBUG: [path_str_sep], [path], [amount]"
for(var/job in jobs)
if(GLOB.custom_item_list[ckey_str][job][path]) //Doesn't exist, make it exist!
if(!GLOB.custom_item_list[ckey_str][job][path]) //Doesn't exist, make it exist!
GLOB.custom_item_list[ckey_str][job][path] = amount
else
GLOB.custom_item_list[ckey_str][job][path] += amount //Exists, we want more~
@@ -8,6 +8,7 @@ SUBSYSTEM_DEF(server_maint)
var/list/currentrun
/datum/controller/subsystem/server_maint/Initialize(timeofday)
reload_custom_roundstart_items_list()
if (config.hub)
world.visibility = 1
..()