diff --git a/code/datums/outfits/outfit_admin.dm b/code/datums/outfits/outfit_admin.dm index ff720ea5db1..3b0dcaf67e6 100644 --- a/code/datums/outfits/outfit_admin.dm +++ b/code/datums/outfits/outfit_admin.dm @@ -1016,7 +1016,7 @@ /obj/item/stack/tile/plasteel = 7 ) -/datum/outfit/admin/tournament_janitor/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) +/datum/outfit/admin/tournament/tournament_janitor/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) . = ..() if(visualsOnly) return diff --git a/code/datums/outfits/vv_outfit.dm b/code/datums/outfits/vv_outfit.dm index 5ab0e3aba83..1b986aa1214 100644 --- a/code/datums/outfits/vv_outfit.dm +++ b/code/datums/outfits/vv_outfit.dm @@ -3,10 +3,10 @@ /datum/outfit/varedit var/list/vv_values var/list/stored_access - var/update_id_name = FALSE //If the name of the human is same as the name on the id they're wearing we'll update provided id when equipping + var/update_id_name = FALSE // If the name of the human is same as the name on the id they're wearing we'll update provided id when equipping /datum/outfit/varedit/pre_equip(mob/living/carbon/human/H, visualsOnly) - H.delete_equipment() //Applying VV to wrong objects is not reccomended. + H.delete_equipment() // Applying VV to wrong objects is not reccomended. . = ..() /datum/outfit/varedit/proc/set_equipment_by_slot(slot, item_path) @@ -46,27 +46,29 @@ /proc/collect_vv(obj/item/I) - //Temporary/Internal stuff, do not copy these. - var/static/list/ignored_vars = list("vars","x","y","z","plane","layer","override","animate_movement","pixel_step_size","screen_loc","fingerprintslast","tip_timer") + if(!istype(I)) + return - if(istype(I)) - var/list/vedits = list() - for(var/varname in I.vars) - if(!I.can_vv_get(varname)) - continue - if(varname in ignored_vars) - continue - var/vval = I.vars[varname] // Can't check initial() because it doesn't work on a list index - //Only text/numbers and icons variables to make it less weirdness prone. - if(!istext(vval) && !isnum(vval) && !isicon(vval)) - continue - vedits[varname] = I.vars[varname] - return vedits + // Temporary/Internal stuff, do not copy these. + var/static/list/ignored_vars = list("vars", "x", "y", "z", "plane", "layer", "override", "animate_movement", "pixel_step_size", "screen_loc", "fingerprintslast", "tip_timer") + + var/list/vedits = list() + for(var/varname in I.vars) + if(!I.can_vv_get(varname)) + continue + if(varname in ignored_vars) + continue + var/vval = I.vars[varname] // Can't check initial() because it doesn't work on a list index + // Only text/numbers and icons variables to make it less weirdness prone. + if(!istext(vval) && !isnum(vval) && !isicon(vval)) + continue + vedits[varname] = I.vars[varname] + return vedits /mob/living/carbon/human/proc/copy_outfit() var/datum/outfit/varedit/O = new - //Copy equipment + // Copy equipment var/list/result = list() var/list/slots_to_check = list(SLOT_HUD_JUMPSUIT, SLOT_HUD_BACK, SLOT_HUD_OUTER_SUIT, SLOT_HUD_BELT, SLOT_HUD_GLOVES, SLOT_HUD_SHOES, SLOT_HUD_HEAD, SLOT_HUD_WEAR_MASK, SLOT_HUD_LEFT_EAR, SLOT_HUD_RIGHT_EAR, SLOT_HUD_GLASSES, SLOT_HUD_WEAR_ID, SLOT_HUD_WEAR_PDA, SLOT_HUD_SUIT_STORE, SLOT_HUD_LEFT_STORE, SLOT_HUD_RIGHT_STORE) for(var/s in slots_to_check) @@ -77,7 +79,7 @@ if(istype(I)) O.set_equipment_by_slot(s, I.type) - //Copy access + // Copy access O.stored_access = list() var/obj/item/id_slot = get_item_by_slot(SLOT_HUD_WEAR_ID) if(id_slot) @@ -86,8 +88,8 @@ if(ID && ID.registered_name == real_name) O.update_id_name = TRUE - //Copy hands - if(l_hand || r_hand) //Not in the mood to let outfits transfer amputees + // Copy hands + if(l_hand || r_hand) // Not in the mood to let outfits transfer amputees var/obj/item/left_hand = l_hand var/obj/item/right_hand = r_hand if(istype(left_hand)) @@ -102,7 +104,7 @@ result["RHAND"] = vedits O.vv_values = result - //Copy backpack contents if exist. + // Copy backpack contents if exist. var/obj/item/backpack = get_item_by_slot(SLOT_HUD_BACK) if(istype(backpack) && LAZYLEN(backpack.contents) > 0) var/list/typecounts = list() @@ -112,9 +114,9 @@ else typecounts[I.type] = 1 O.backpack_contents = typecounts - //TODO : Copy varedits from backpack stuff too. + // TODO : Copy varedits from backpack stuff too. - //Copy implants + // Copy implants O.implants = list() for(var/obj/item/implant/I in contents) if(istype(I)) @@ -134,7 +136,7 @@ if(istype(A)) O.accessories |= A - //Copy to outfit cache + // Copy to outfit cache var/outfit_name = stripped_input(usr, "Enter the outfit name") O.name = outfit_name GLOB.custom_outfits += O @@ -142,7 +144,8 @@ /datum/outfit/varedit/post_equip(mob/living/carbon/human/H, visualsOnly) . = ..() - //Apply VV + + // Apply VV for(var/slot in vv_values) var/list/edits = vv_values[slot] var/obj/item/I @@ -155,15 +158,18 @@ I = H.get_item_by_slot(text2num(slot)) for(var/vname in edits) I.vv_edit_var(vname,edits[vname]) - //Apply access + + // Apply access var/obj/item/id_slot = H.get_item_by_slot(SLOT_HUD_WEAR_ID) - if(id_slot) - var/obj/item/card/id/card = id_slot.GetID() - if(istype(card)) - card.access |= stored_access - if(update_id_name) - card.registered_name = H.real_name - card.update_label() + if(!id_slot) + return + + var/obj/item/card/id/card = id_slot.GetID() + if(istype(card)) + card.access |= stored_access + if(update_id_name) + card.registered_name = H.real_name + card.update_label() /datum/outfit/varedit/get_json_data() . = .. () diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 542d9f6cdc3..add4b2a57f3 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -663,7 +663,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention) ) var/list/outfits = list() - var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job) + var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job) - list(/datum/outfit/varedit, /datum/outfit/admin) for(var/path in paths) var/datum/outfit/O = path //not much to initalize here but whatever if(initial(O.can_be_admin_equipped))