From de6eb16e1aeca7cb62c86394a34ab2b439ac620c Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 20 Aug 2013 10:37:05 +0100 Subject: [PATCH 1/9] Fixes being able to have alien species hair on humans or other species. --- code/__HELPERS/mobs.dm | 43 +++++++++++++++---- code/modules/client/preferences.dm | 4 +- .../mob/new_player/preferences_setup.dm | 4 +- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 9156b5b416a..324cfad6323 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -1,14 +1,41 @@ proc/random_hair_style(gender, species = "Human") - switch(gender) - if(MALE) return pick(hair_styles_male_list) - if(FEMALE) return pick(hair_styles_female_list) - else return pick(hair_styles_list) + var/h_style = "Bald" + + var/list/valid_hairstyles = list() + for(var/hairstyle in hair_styles_list) + var/datum/sprite_accessory/S = hair_styles_list[hairstyle] + if(gender == MALE && S.gender == FEMALE) + continue + if(gender == FEMALE && S.gender == MALE) + continue + if( !(species in S.species_allowed)) + continue + valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] + + if(valid_hairstyles.len) + h_style = pick(valid_hairstyles) + + return h_style proc/random_facial_hair_style(gender, species = "Human") - switch(gender) - if(MALE) return pick(facial_hair_styles_male_list) - if(FEMALE) return pick(facial_hair_styles_female_list) - else return pick(facial_hair_styles_list) + var/f_style = "Shaved" + + var/list/valid_facialhairstyles = list() + for(var/facialhairstyle in facial_hair_styles_list) + var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] + if(gender == MALE && S.gender == FEMALE) + continue + if(gender == FEMALE && S.gender == MALE) + continue + if( !(species in S.species_allowed)) + continue + + valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle] + + if(valid_facialhairstyles.len) + f_style = pick(valid_facialhairstyles) + + return f_style proc/random_name(gender, species = "Human") if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 597ad94ebfd..cdf4e8e20ff 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -764,13 +764,13 @@ datum/preferences g_hair = rand(0,255) b_hair = rand(0,255) if("h_style") - h_style = random_hair_style(gender) + h_style = random_hair_style(gender, species) if("facial") r_facial = rand(0,255) g_facial = rand(0,255) b_facial = rand(0,255) if("f_style") - f_style = random_facial_hair_style(gender) + f_style = random_facial_hair_style(gender, species) if("underwear") underwear = rand(1,underwear_m.len) ShowChoices(user) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 48c6127a4be..86ed744fcca 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -7,8 +7,8 @@ datum/preferences else gender = FEMALE s_tone = random_skin_tone() - h_style = random_hair_style(gender) - f_style = random_facial_hair_style(gender) + h_style = random_hair_style(gender, species) + f_style = random_facial_hair_style(gender, species) randomize_hair_color("hair") randomize_hair_color("facial") randomize_eyes_color() From ec3000ecfb2609cbcc5116169aa640e1d89815b5 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 20 Aug 2013 10:37:57 +0100 Subject: [PATCH 2/9] Experimentally readding Delete Book verb. --- code/modules/admin/admin_verbs.dm | 6 ++++-- code/modules/library/lib_machines.dm | 28 ++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 7f821923415..717924eb814 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -69,7 +69,8 @@ var/list/admin_verbs_admin = list( /client/proc/check_customitem_activity, /client/proc/man_up, /client/proc/global_man_up, - /client/proc/response_team // Response Teams admin verb + /client/proc/response_team, // Response Teams admin verb + /client/proc/delbook ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, @@ -121,7 +122,8 @@ var/list/admin_verbs_server = list( /datum/admins/proc/toggle_aliens, /datum/admins/proc/toggle_space_ninja, /client/proc/toggle_random_events, - /client/proc/check_customitem_activity + /client/proc/check_customitem_activity, + /client/proc/delbook ) var/list/admin_verbs_debug = list( /client/proc/cmd_admin_list_open_jobs, diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index a47d80309d0..08b0c4f3bdc 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -195,7 +195,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f else dat += "(Order book by SS13BN)

" dat += "" - dat += "" + dat += "" var/DBQuery/query = dbcon_old.NewQuery("SELECT id, author, title, category FROM library") query.Execute() @@ -205,7 +205,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f var/author = query.item[2] var/title = query.item[3] var/category = query.item[4] - dat += "" + dat += "" dat += "
AUTHORTITLECATEGORY
AUTHORTITLECATEGORYID
[author][title][category]\[Order\]
[author][title][category][id]\[Order\]
" dat += "
(Return to main menu)
" if(5) @@ -463,3 +463,27 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f del(O) else ..() + +/client/proc/delbook() + set name = "Delete Book" + set desc = "Permamently deletes a book from the database." + set category = "Admin" + if(!src.holder) + src << "Only administrators may use this command." + return + + var/isbn = input("ISBN number?", "Delete Book") as num | null + if(!isbn) + return + + if(dbcon_old.IsConnected()) + var/DBConnection/dbcon = new() + dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") + if(!dbcon.IsConnected()) + alert("Connection to Archive has been severed. Aborting.") + else + var/DBQuery/query = dbcon.NewQuery("DELETE FROM library WHERE id=[isbn]") + if(!query.Execute()) + usr << query.ErrorMsg() + dbcon.Disconnect() + log_admin("[usr.key] has deleted the book [isbn]") \ No newline at end of file From 16d9b765995e77713a572d74edc66853cdde9ea3 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 20 Aug 2013 10:38:57 +0100 Subject: [PATCH 3/9] Allow all mobs to emote. Standardising emote proc. --- .../mob/living/carbon/alien/humanoid/emote.dm | 21 +++++++++++++++--- .../mob/living/carbon/alien/larva/emote.dm | 21 +++++++++++++++--- code/modules/mob/living/carbon/brain/emote.dm | 17 ++++++++++++++ code/modules/mob/living/carbon/human/emote.dm | 4 ++-- .../mob/living/carbon/metroid/emote.dm | 22 ++++++++++++++----- .../modules/mob/living/carbon/monkey/emote.dm | 21 +++++++++++++----- 6 files changed, 87 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm index 087422810c3..71dc56ef402 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/humanoid/emote(var/act) +/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -9,10 +9,25 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - var/m_type = 1 - var/message switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if("sign") if (!src.restrained()) message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm index 2be246fe8fb..375c5c6b0c9 100644 --- a/code/modules/mob/living/carbon/alien/larva/emote.dm +++ b/code/modules/mob/living/carbon/alien/larva/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/alien/larva/emote(var/act) +/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -9,10 +9,25 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - var/m_type = 1 - var/message switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if("sign") if (!src.restrained()) message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm index 8f83bd390ab..1995ff5e1cc 100644 --- a/code/modules/mob/living/carbon/brain/emote.dm +++ b/code/modules/mob/living/carbon/brain/emote.dm @@ -12,6 +12,23 @@ if(src.stat == DEAD) return switch(act) + if ("me") + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + + if ("custom") + return custom_emote(m_type, message) if ("alarm") src << "You sound an alarm." message = "[src] sounds an alarm." diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 4029fc46444..591e4426e09 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -63,7 +63,7 @@ else alert("Unable to use this emote, must be either hearable or visible.") return - message = "[src] [input]" + return custom_emote(m_type, message) if ("me") if(silent) @@ -78,7 +78,7 @@ return if(!(message)) return - message = "[src] [message]" + return custom_emote(m_type, message) if ("salute") if (!src.buckled) diff --git a/code/modules/mob/living/carbon/metroid/emote.dm b/code/modules/mob/living/carbon/metroid/emote.dm index 0e6688e69ea..2f6f0005396 100644 --- a/code/modules/mob/living/carbon/metroid/emote.dm +++ b/code/modules/mob/living/carbon/metroid/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/slime/emote(var/act, var/type, var/desc) +/mob/living/carbon/slime/emote(var/act,var/m_type=1,var/message = null) if (findtext(act, "-", 1, null)) @@ -9,14 +9,24 @@ if(findtext(act,"s",-1) && !findtext(act,"_",-2))//Removes ending s's unless they are prefixed with a '_' act = copytext(act,1,length(act)) - var/m_type = 1 - var/message - switch(act) if ("me") - return custom_emote(m_type, desc) + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + if ("custom") - return custom_emote(m_type, desc) + return custom_emote(m_type, message) if("moan") message = "The [src.name] moans." m_type = 2 diff --git a/code/modules/mob/living/carbon/monkey/emote.dm b/code/modules/mob/living/carbon/monkey/emote.dm index 8e6c281c781..615fb631d0e 100644 --- a/code/modules/mob/living/carbon/monkey/emote.dm +++ b/code/modules/mob/living/carbon/monkey/emote.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/monkey/emote(var/act, var/type, var/desc) +/mob/living/carbon/monkey/emote(var/act,var/m_type=1,var/message = null) var/param = null if (findtext(act, "-", 1, null)) @@ -10,15 +10,26 @@ act = copytext(act,1,length(act)) var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - var/m_type = 1 - var/message switch(act) if ("me") - return custom_emote(m_type, desc) + if(silent) + return + if (src.client) + if (client.prefs.muted & MUTE_IC) + src << "\red You cannot send IC messages (muted)." + return + if (src.client.handle_spam_prevention(message,MUTE_IC)) + return + if (stat) + return + if(!(message)) + return + return custom_emote(m_type, message) + if ("custom") - return custom_emote(m_type, desc) + return custom_emote(m_type, message) if("sign") if (!src.restrained()) From b6900d50fc4a7762b645138cf5ea4cc62c17306f Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 20 Aug 2013 14:20:33 +0100 Subject: [PATCH 4/9] Fixes admins not spawning as aliens on roundstart. --- code/modules/admin/holder2.dm | 2 +- code/modules/mob/new_player/new_player.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 2f0a38f985b..34b4cacde93 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -48,7 +48,7 @@ proc/admin_proc() world << "you have enough rights!" NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc which they did not call -you will have to do something like if(client.rights & R_ADMIN) yourself. +you will have to do something like if(client.holder.rights & R_ADMIN) yourself. */ /proc/check_rights(rights_required, show_msg=1) if(usr && usr.client) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 9fa5357d103..c1e808a6bdc 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -347,7 +347,7 @@ if(client.prefs.species) chosen_species = all_species[client.prefs.species] if(chosen_species) - if(is_alien_whitelisted(src, client.prefs.species) || !config.usealienwhitelist || !(chosen_species.flags & WHITELISTED)) + if(is_alien_whitelisted(src, client.prefs.species) || !config.usealienwhitelist || !(chosen_species.flags & WHITELISTED) || (client.holder.rights & R_ADMIN) )// Have to recheck admin due to no usr at roundstart. Latejoins are fine though. new_character.set_species(client.prefs.species) if(chosen_species.language) new_character.add_language(chosen_species.language) From 13caefe13803498dcb435064db63226ac6381822 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 20 Aug 2013 14:20:46 +0100 Subject: [PATCH 5/9] Uncomments Space Law book content. --- code/game/objects/items/weapons/manuals.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm index cc2c284adce..0f65736b507 100644 --- a/code/game/objects/items/weapons/manuals.dm +++ b/code/game/objects/items/weapons/manuals.dm @@ -584,7 +584,7 @@ icon_state = "bookSpaceLaw" author = "Nanotrasen" title = "Space Law" - /*dat = {" + dat = {" @@ -594,7 +594,7 @@ - "}*/ + "} /obj/item/weapon/book/manual/engineering_guide name = "Engineering Textbook" From d3775875df6c4f4f53bf1f13b43fc31cbeee09ba Mon Sep 17 00:00:00 2001 From: Erthilo Date: Wed, 21 Aug 2013 09:10:21 +0100 Subject: [PATCH 6/9] Revert "Experimentally readding Delete Book verb." This reverts commit ec3000ecfb2609cbcc5116169aa640e1d89815b5. --- code/modules/admin/admin_verbs.dm | 6 ++---- code/modules/library/lib_machines.dm | 28 ++-------------------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 717924eb814..7f821923415 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -69,8 +69,7 @@ var/list/admin_verbs_admin = list( /client/proc/check_customitem_activity, /client/proc/man_up, /client/proc/global_man_up, - /client/proc/response_team, // Response Teams admin verb - /client/proc/delbook + /client/proc/response_team // Response Teams admin verb ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, @@ -122,8 +121,7 @@ var/list/admin_verbs_server = list( /datum/admins/proc/toggle_aliens, /datum/admins/proc/toggle_space_ninja, /client/proc/toggle_random_events, - /client/proc/check_customitem_activity, - /client/proc/delbook + /client/proc/check_customitem_activity ) var/list/admin_verbs_debug = list( /client/proc/cmd_admin_list_open_jobs, diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 08b0c4f3bdc..a47d80309d0 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -195,7 +195,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f else dat += "(Order book by SS13BN)

" dat += "" - dat += "" + dat += "" var/DBQuery/query = dbcon_old.NewQuery("SELECT id, author, title, category FROM library") query.Execute() @@ -205,7 +205,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f var/author = query.item[2] var/title = query.item[3] var/category = query.item[4] - dat += "" + dat += "" dat += "
AUTHORTITLECATEGORYID
AUTHORTITLECATEGORY
[author][title][category][id]\[Order\]
[author][title][category]\[Order\]
" dat += "
(Return to main menu)
" if(5) @@ -463,27 +463,3 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f del(O) else ..() - -/client/proc/delbook() - set name = "Delete Book" - set desc = "Permamently deletes a book from the database." - set category = "Admin" - if(!src.holder) - src << "Only administrators may use this command." - return - - var/isbn = input("ISBN number?", "Delete Book") as num | null - if(!isbn) - return - - if(dbcon_old.IsConnected()) - var/DBConnection/dbcon = new() - dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]") - if(!dbcon.IsConnected()) - alert("Connection to Archive has been severed. Aborting.") - else - var/DBQuery/query = dbcon.NewQuery("DELETE FROM library WHERE id=[isbn]") - if(!query.Execute()) - usr << query.ErrorMsg() - dbcon.Disconnect() - log_admin("[usr.key] has deleted the book [isbn]") \ No newline at end of file From d7fc84b42b565ac6e8b3fcf7d0d895aa9fcfb844 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Wed, 21 Aug 2013 09:59:07 +0100 Subject: [PATCH 7/9] Better gender checks. --- code/__HELPERS/mobs.dm | 12 ++++-------- code/modules/client/preferences.dm | 12 +++--------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 324cfad6323..df7e4f18901 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -4,11 +4,9 @@ proc/random_hair_style(gender, species = "Human") var/list/valid_hairstyles = list() for(var/hairstyle in hair_styles_list) var/datum/sprite_accessory/S = hair_styles_list[hairstyle] - if(gender == MALE && S.gender == FEMALE) + if(gender != S.gender) continue - if(gender == FEMALE && S.gender == MALE) - continue - if( !(species in S.species_allowed)) + if(!(species in S.species_allowed)) continue valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] @@ -23,11 +21,9 @@ proc/random_facial_hair_style(gender, species = "Human") var/list/valid_facialhairstyles = list() for(var/facialhairstyle in facial_hair_styles_list) var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] - if(gender == MALE && S.gender == FEMALE) + if(gender != S.gender) continue - if(gender == FEMALE && S.gender == MALE) - continue - if( !(species in S.species_allowed)) + if(!(species in S.species_allowed)) continue valid_facialhairstyles[facialhairstyle] = facial_hair_styles_list[facialhairstyle] diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index cdf4e8e20ff..f4cb339f045 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -822,9 +822,7 @@ datum/preferences var/list/valid_hairstyles = list() for(var/hairstyle in hair_styles_list) var/datum/sprite_accessory/S = hair_styles_list[hairstyle] - if(gender == MALE && S.gender == FEMALE) - continue - if(gender == FEMALE && S.gender == MALE) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue @@ -840,9 +838,7 @@ datum/preferences var/list/valid_facialhairstyles = list() for(var/facialhairstyle in facial_hair_styles_list) var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] - if(gender == MALE && S.gender == FEMALE) - continue - if(gender == FEMALE && S.gender == MALE) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue @@ -925,9 +921,7 @@ datum/preferences var/list/valid_facialhairstyles = list() for(var/facialhairstyle in facial_hair_styles_list) var/datum/sprite_accessory/S = facial_hair_styles_list[facialhairstyle] - if(gender == MALE && S.gender == FEMALE) - continue - if(gender == FEMALE && S.gender == MALE) + if(gender != S.gender) continue if( !(species in S.species_allowed)) continue From 740a44b600f77f8342e8c582977e8ef23f673b1f Mon Sep 17 00:00:00 2001 From: Mloc Date: Wed, 21 Aug 2013 20:27:14 +0100 Subject: [PATCH 8/9] Tweaked gitignore. --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c1e9211514f..e7f44a7c441 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ +#ignore misc BYOND files *.log *.int *.rsc *.dmb *.lk -info.json -/config/admins.txt + +#ignore any files in config/, except those in subdirectories. +/config/* +!/config/*/* From 5cee2d2ac2b1d141a26b8d6c8275e1274e4f0e3e Mon Sep 17 00:00:00 2001 From: Mloc-Argent Date: Wed, 21 Aug 2013 23:26:59 +0100 Subject: [PATCH 9/9] Species will no longer draw hair not allowed for them. Mirrors will no longer let you choose disallowed hair styles. --- code/game/objects/structures/mirror.dm | 22 +++++++++++++++++-- .../mob/living/carbon/human/update_icons.dm | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index c6a448be97e..0937e72d848 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -22,13 +22,31 @@ //handle facial hair (if necessary) if(H.gender == MALE) - var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list + var/list/species_facial_hair = list() + if(H.species) + for(var/i in facial_hair_styles_list) + var/datum/sprite_accessory/facial_hair/tmp_facial = facial_hair_styles_list[i] + if(H.species.name in tmp_facial.species_allowed) + species_facial_hair += i + else + species_facial_hair = facial_hair_styles_list + + var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in species_facial_hair if(userloc != H.loc) return //no tele-grooming if(new_style) H.f_style = new_style //handle normal hair - var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list + var/list/species_hair = list() + if(H.species) + for(var/i in hair_styles_list) + var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i] + if(H.species.name in tmp_hair.species_allowed) + species_hair += i + else + species_hair = hair_styles_list + + var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in species_hair if(userloc != H.loc) return //no tele-grooming if(new_style) H.h_style = new_style diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 1526203f9ba..507f38723a4 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -347,7 +347,7 @@ proc/get_damage_icon_part(damage_state, body_part) if(f_style) var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style] - if(facial_hair_style) + if(facial_hair_style && src.species.name in facial_hair_style.species_allowed) var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s") var/icon/facial_l = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_l") facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD) @@ -357,7 +357,7 @@ proc/get_damage_icon_part(damage_state, body_part) if(h_style && !(head && (head.flags & BLOCKHEADHAIR))) var/datum/sprite_accessory/hair_style = hair_styles_list[h_style] - if(hair_style) + if(hair_style && src.species.name in hair_style.species_allowed) var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") var/icon/hair_l = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_l") hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)