From c49a4f9c0010b78bed73eb6f14de961841a126bc Mon Sep 17 00:00:00 2001 From: JohnWildkins Date: Sun, 10 Nov 2019 13:56:22 -0500 Subject: [PATCH] fix antags not spawning with chosen backpack (#7383) title, fix no. 30492034 for the loadout refactor that totally didn't just make things worse (tm) --- code/datums/outfits/outfit.dm | 18 +++++++++--------- code/game/jobs/job/job.dm | 10 ---------- html/changelogs/johnwildkins-loadout3.yml | 6 ++++++ 3 files changed, 15 insertions(+), 19 deletions(-) create mode 100644 html/changelogs/johnwildkins-loadout3.yml diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index cbd084b1dcc..9a48dc2f876 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -59,6 +59,13 @@ back = use_job_specific ? messengerbag : /obj/item/weapon/storage/backpack/messenger else back = backpack //Department backpack + if(back) + equip_item(H, back, slot_back) + + if(istype(H.back,/obj/item/weapon/storage/backpack)) + var/obj/item/weapon/storage/backpack/B = H.back + B.autodrobe_no_remove = TRUE + return // Used to equip an item to the mob. Mainly to prevent copypasta for collect_not_del. @@ -68,15 +75,8 @@ if(isnum(path)) //Check if parameter is not numeric. Must be a path, list of paths or name of a gear datum CRASH("Outfit [name] - Parameter path: [path] is numeric.") - if(islist(path)) //If its a list, select a random item; if back, try to use preference - var/list/pathlist = path - var/itempath - if(is_type_in_list(/obj/item/weapon/storage/backpack, pathlist) && H.backbag && pathlist.len == 5) - if(H.backbag < 2) - return // They don't want a backpack - itempath = pathlist[H.backbag - 2] - else - itempath = pick(pathlist) + if(islist(path)) //If its a list, select a random item + var/itempath = pick(path) I = new itempath(H) else if(gear_datums[path]) //If its something else, we´ll check if its a gearpath and try to spawn it var/datum/gear/G = gear_datums[path] diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 2dcc540dbca..2e00b8baf85 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -198,16 +198,6 @@ var/box = /obj/item/weapon/storage/box/survival -/datum/outfit/job/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE) - . = ..() - - if(back) - equip_item(H, back, slot_back) - - if(istype(H.back,/obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = H.back - B.autodrobe_no_remove = TRUE - /datum/outfit/job/equip(mob/living/carbon/human/H, visualsOnly = FALSE) back = null //Nulling the backpack here, since we already equipped the backpack in pre_equip if(box) diff --git a/html/changelogs/johnwildkins-loadout3.yml b/html/changelogs/johnwildkins-loadout3.yml new file mode 100644 index 00000000000..d85592a40e1 --- /dev/null +++ b/html/changelogs/johnwildkins-loadout3.yml @@ -0,0 +1,6 @@ +author: JohnWildkins + +delete-after: True + +changes: + - bugfix: "Fix certain antags not spawning with their chosen backpack preference."