From d7fc84b42b565ac6e8b3fcf7d0d895aa9fcfb844 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Wed, 21 Aug 2013 09:59:07 +0100 Subject: [PATCH] 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