diff --git a/code/citadel/custom_loadout/load_to_mob.dm b/code/citadel/custom_loadout/load_to_mob.dm index 65eeea3093..8c5d608cd8 100644 --- a/code/citadel/custom_loadout/load_to_mob.dm +++ b/code/citadel/custom_loadout/load_to_mob.dm @@ -9,6 +9,7 @@ /proc/handle_roundstart_items(mob/living/M) if(!istype(M) || !M.ckey || !M.mind) + to_chat(world, "DEBUG: handle_roundstart_items: No ckey, mind, or not a mob.") return FALSE return load_itemlist_to_mob(M, parse_custom_roundstart_items(M.ckey, M.name, M.mind.assigned_role, M.mind.special_role), TRUE, TRUE, FALSE) @@ -16,6 +17,7 @@ /proc/load_itemlist_to_mob(mob/living/L, list/itemlist, drop_on_floor_if_full = TRUE, load_to_all_slots = TRUE, replace_slots = FALSE) to_chat(world, "load_itemlist_to_mob([L], [itemlist], [drop_on_floor_if_full], [load_to_all_slots], [replace_slots])") if(!istype(L) || !islist(itemlist)) + to_chat(world, "DEBUG: load_itemlist_to_mob: not a mob or not an itemlist") return FALSE var/loading_mode = DROP_TO_FLOOR var/turf/current_turf = get_turf(L) @@ -36,6 +38,7 @@ /proc/load_itemlist_to_human(mob/living/carbon/human/H, list/itemlist, drop_on_floor_if_full = TRUE, load_to_all_slots = TRUE, replace_slots = FALSE) if(!istype(H) || !islist(itemlist)) + to_chat(world, "DEBUG: load_itemlist_to_human: Not a human or not an itemlist") return FALSE var/turf/T = get_turf(H) for(var/item in itemlist) @@ -54,7 +57,7 @@ loaded_atom.forceMove(T) continue var/obj/item/loaded = loaded_atom - var/obj/item/weapon/storage/S = H.get_item_by_slot(slot_back) + var/obj/item/storage/S = H.get_item_by_slot(slot_back) if(istype(S)) S.handle_item_insertion(loaded, TRUE, H) //Force it into their backpack continue diff --git a/code/citadel/custom_loadout/read_from_file.dm b/code/citadel/custom_loadout/read_from_file.dm index eb75c88c2e..d4af163b7e 100644 --- a/code/citadel/custom_loadout/read_from_file.dm +++ b/code/citadel/custom_loadout/read_from_file.dm @@ -27,8 +27,6 @@ GLOBAL_LIST(custom_item_list) var/item_str = copytext(line, job_str_sep+1, item_str_sep) if(!ckey_str || !char_str || !job_str || !item_str || !length(ckey_str) || !length(char_str) || !length(job_str) || !length(item_str)) log_admin("Errored custom_items_whitelist line: [line] - Component/separator missing!") - to_chat(world, "DEBUG: Line process: [line]") - to_chat(world, "DEBUG: [ckey_str_sep], [char_str_sep], [job_str_sep], [item_str_sep], [ckey_str], [char_str], [job_str], [item_str].") if(!islist(GLOB.custom_item_list[ckey_str])) GLOB.custom_item_list[ckey_str] = list() //Initialize list for this ckey if it isn't initialized.. var/list/characters = splittext(char_str, "/") @@ -36,8 +34,6 @@ GLOBAL_LIST(custom_item_list) if(!islist(GLOB.custom_item_list[ckey_str][character])) GLOB.custom_item_list[ckey_str][character] = list() var/list/jobs = splittext(job_str, "/") - world << "DEBUG: Job string processed." - world << "DEBUG: JOBS: [english_list(jobs)]" for(var/job in jobs) for(var/character in characters) if(!islist(GLOB.custom_item_list[ckey_str][character][job])) @@ -52,7 +48,6 @@ GLOBAL_LIST(custom_item_list) path = text2path(path) if(!ispath(path) || !isnum(amount)) log_admin("Errored custom_items_whitelist line: [line] - Path/number for item missing or invalid.") - world << "DEBUG: [path_str_sep], [path], [amount]" for(var/character in characters) for(var/job in jobs) if(!GLOB.custom_item_list[ckey_str][character][job][path]) //Doesn't exist, make it exist! @@ -61,17 +56,16 @@ GLOBAL_LIST(custom_item_list) GLOB.custom_item_list[ckey_str][character][job][path] += amount //Exists, we want more~ return GLOB.custom_item_list -/proc/parse_custom_roundstart_items(ckey, char_name = "ANY", job_name = "ANY", special_role) +/proc/parse_custom_roundstart_items(ckey, char_name = "ALL", job_name = "ALL", special_role) var/list/ret = list() if(GLOB.custom_item_list[ckey]) for(var/char in GLOB.custom_item_list[ckey]) - if((char_name == char) || (char_name == "ANY") || (char == "ANY")) + if((char_name == char) || (char_name == "ALL") || (char == "ALL")) for(var/job in GLOB.custom_item_list[ckey][char]) - if((job_name == job) || (job == "ANY") || (job_name == "ANY") || (special_role && (job == special_role))) + if((job_name == job) || (job == "ALL") || (job_name == "ALL") || (special_role && (job == special_role))) for(var/item_path in GLOB.custom_item_list[ckey][char][job]) if(ret[item_path]) ret[item_path] += GLOB.custom_item_list[ckey][char][job][item_path] else ret[item_path] = GLOB.custom_item_list[ckey][char][job][item_path] - to_chat(world, "debug: parsing returned [english_list(ret)]") return ret diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index f28373ef22..ac2ffec42f 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -407,7 +407,7 @@ SUBSYSTEM_DEF(job) if(job && H) job.after_spawn(H, M) - + handle_roundstart_items(H) return H diff --git a/config/custom_roundstart_items.txt b/config/custom_roundstart_items.txt index b71836fe53..8564ca48b6 100644 --- a/config/custom_roundstart_items.txt +++ b/config/custom_roundstart_items.txt @@ -3,7 +3,7 @@ //if there's multiple entries of a single ckey the later ones will add to the earlier definitions. //is obviously a comment. //Recommend defining one job per line, but do what you want. -test1|Secondary Memenamefortesting|testjob1/test job 2/ALL|/obj/item/weapon/gun/energy/laser=3;/obj/item/weapon/gun/energy/laser/retro=1;/obj/item/weapon/gun/energy=2 -test1|Memename Lastname|testjob1|/obj/item/device/aicard=3;/obj/item/device/flightpack=1;/obj/item/weapon/gun/energy=3 -kevinz000|Skylar Lineman|ALL|/obj/item/weapon/bikehorn/airhorn=1 -kevinz000|ALL|Clown|/obj/item/weapon/bikehorn=1 +test1|Secondary Memenamefortesting|testjob1/test job 2/ALL|/obj/item/gun/energy/laser=3;/obj/item/gun/energy/laser/retro=1;/obj/item/gun/energy=2 +test1|Memename Lastname|testjob1|/obj/item/device/aicard=3;/obj/item/device/flightpack=1;/obj/item/gun/energy=3 +kevinz000|Skylar Lineman|ALL|/obj/item/bikehorn/airhorn=1 +kevinz000|ALL|Clown|/obj/item/bikehorn=1