From fdeff0ed39bb058beceade17128015dfc328e9fa Mon Sep 17 00:00:00 2001 From: Poojawa Date: Sun, 11 Mar 2018 07:39:38 -0500 Subject: [PATCH] Ckey locks work! HOORAY! --- code/modules/client/preferences.dm | 40 +++++++++++++------ .../new_player/sprite_accessories_Citadel.dm | 6 +-- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 6e534e76e8..65cdcc03d2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1273,6 +1273,13 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["taur"] = "None" if("tail_human") + var/list/snowflake_tails_list = list("Normal" = null) + for(var/path in GLOB.tails_list_human) + var/datum/sprite_accessory/tails/human/instance = GLOB.tails_list_human[path] + if(istype(instance, /datum/sprite_accessory)) + var/datum/sprite_accessory/S = instance + if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) + snowflake_tails_list[S.name] = path var/new_tail new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_human if(new_tail) @@ -1281,17 +1288,13 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["taur"] = "None" if("mam_tail") - // var/datum/gear/gear = GLOB.loadout_items[gear_tab][j] - // var/donoritem - // if(gear.ckeywhitelist && gear.ckeywhitelist.len) - // donoritem = TRUE - // if(!(user.ckey in gear.ckeywhitelist)) - var/list/snowflake_tails_list = list("Normal" = null) for(var/path in GLOB.mam_tails_list) var/datum/sprite_accessory/mam_tails/instance = GLOB.mam_tails_list[path] - if((!instance.ckeys_allowed) || (user.client && instance.ckeys_allowed && instance.ckeys_allowed.len && instance.ckeys_allowed.Find(user.client.ckey))) - snowflake_tails_list[instance.name] = path + if(istype(instance, /datum/sprite_accessory)) + var/datum/sprite_accessory/S = instance + if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) + snowflake_tails_list[S.name] = path var/new_tail new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in snowflake_tails_list if(new_tail) @@ -1300,8 +1303,15 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["taur"] = "None" if("taur") + var/list/snowflake_taur_list = list("Normal" = null) + for(var/path in GLOB.taur_list) + var/datum/sprite_accessory/taur/instance = GLOB.taur_list[path] + if(istype(instance, /datum/sprite_accessory)) + var/datum/sprite_accessory/S = instance + if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) + snowflake_taur_list[S.name] = path var/new_taur - new_taur = input(user, "Choose your character's tauric body:", "Character Preference") as null|anything in GLOB.taur_list + new_taur = input(user, "Choose your character's tauric body:", "Character Preference") as null|anything in snowflake_taur_list if(new_taur) features["taur"] = new_taur if(new_taur != "None") @@ -1318,8 +1328,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/list/snowflake_ears_list = list("Normal" = null) for(var/path in GLOB.mam_ears_list) var/datum/sprite_accessory/mam_ears/instance = GLOB.mam_ears_list[path] - if((!instance.ckeys_allowed) || (user.ckey in instance.ckeys_allowed)) - snowflake_ears_list[instance.name] = path + if(istype(instance, /datum/sprite_accessory)) + var/datum/sprite_accessory/S = instance + if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) + snowflake_ears_list[S.name] = path var/new_ears new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in snowflake_ears_list if(new_ears) @@ -1371,8 +1383,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/list/snowflake_markings_list = list("Normal" = null) for(var/path in GLOB.mam_body_markings_list) var/datum/sprite_accessory/mam_body_markings/instance = GLOB.mam_body_markings_list[path] - if((!instance.ckeys_allowed) || (user.ckey in instance.ckeys_allowed)) - snowflake_markings_list[instance.name] = path + if(istype(instance, /datum/sprite_accessory)) + var/datum/sprite_accessory/S = instance + if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey))) + snowflake_markings_list[S.name] = path var/new_mam_body_markings new_mam_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in snowflake_markings_list if(new_mam_body_markings) diff --git a/code/modules/mob/dead/new_player/sprite_accessories_Citadel.dm b/code/modules/mob/dead/new_player/sprite_accessories_Citadel.dm index a09c5c30d3..26672519b4 100644 --- a/code/modules/mob/dead/new_player/sprite_accessories_Citadel.dm +++ b/code/modules/mob/dead/new_player/sprite_accessories_Citadel.dm @@ -971,13 +971,13 @@ icon_state = "sabresune" extra = TRUE extra_color_src = MUTCOLORS3 - ckeys_allowed = list("Poojawa") + ckeys_allowed = list("poojawa") /datum/sprite_accessory/mam_tails/sabresune name = "sabresune" icon_state = "sabresune" extra = TRUE - ckeys_allowed = list("Poojawa") + ckeys_allowed = list("poojawa") /datum/sprite_accessory/mam_tails_animated/sabresune @@ -991,5 +991,5 @@ color_src = MUTCOLORS2 extra = FALSE extra2 = FALSE - ckeys_allowed = list("Poojawa") + ckeys_allowed = list("poojawa")