Species Refactor Fixes

This commit is contained in:
Fox McCloud
2018-07-23 01:28:58 -04:00
parent c77e2ee73f
commit ebe0b82bb0
10 changed files with 23 additions and 35 deletions
@@ -3,17 +3,6 @@
AC.flags = flags
AC.ui_interact(user, state = state)
/mob/living/carbon/human/proc/change_species(datum/species/new_species)
if(!new_species || dna.species.type == new_species || !ispath(new_species, /datum/species))
return FALSE
set_species(new_species, null, TRUE)
reset_hair()
if(dna.species.bodyflags & HAS_MARKINGS)
reset_markings()
return TRUE
/mob/living/carbon/human/proc/change_gender(var/new_gender, var/update_dna = 1)
var/obj/item/organ/external/head/H = bodyparts_by_name["head"]
if(gender == new_gender || (gender == PLURAL && dna.species.has_gender))
@@ -321,8 +310,8 @@
/mob/living/carbon/human/proc/generate_valid_species(var/check_whitelist = 1, var/list/whitelist = list(), var/list/blacklist = list())
var/list/valid_species = new()
for(var/current_species_name in all_species)
var/datum/species/current_species = all_species[current_species_name]
for(var/current_species_name in GLOB.all_species)
var/datum/species/current_species = GLOB.all_species[current_species_name]
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
if(whitelist.len && !(current_species_name in whitelist))
+1 -1
View File
@@ -549,7 +549,7 @@
/mob/new_player/proc/check_prefs_are_sane()
var/datum/species/chosen_species
if(client.prefs.species)
chosen_species = all_species[client.prefs.species]
chosen_species = GLOB.all_species[client.prefs.species]
if(!(chosen_species && (is_species_whitelisted(chosen_species) || has_admin_rights())))
// Have to recheck admin due to no usr at roundstart. Latejoins are fine though.
log_runtime(EXCEPTION("[src] had species [client.prefs.species], though they weren't supposed to. Setting to Human."), src)
@@ -1,10 +1,10 @@
/datum/preferences
//The mob should have a gender you want before running this proc. Will run fine without H
/datum/preferences/proc/random_character(gender_override)
var/datum/species/S = all_species[species]
var/datum/species/S = GLOB.all_species[species]
if(!istype(S)) //The species was invalid. Set the species to the default, fetch the datum for that species and generate a random character.
species = initial(species)
S = all_species[species]
S = GLOB.all_species[species]
var/datum/robolimb/robohead
if(S.bodyflags & ALL_RPARTS)
@@ -216,7 +216,7 @@
if(gender == FEMALE) g = "f"
var/icon/icobase
var/datum/species/current_species = all_species[species]
var/datum/species/current_species = GLOB.all_species[species]
//Icon-based species colour.
var/coloured_tail