[TM prolly] Some init optimisationss (#23800)

* [TM prolly] Some init optimisationss

* Do this as well

* Sod it some runtime optimisations as well
This commit is contained in:
AffectedArc07
2024-02-04 21:17:50 +00:00
committed by GitHub
parent d10e1adcae
commit 3ab2a08d86
9 changed files with 54 additions and 23 deletions
+3 -4
View File
@@ -1784,7 +1784,7 @@
/datum/character_save/proc/copy_to(mob/living/carbon/human/character)
var/datum/species/S = GLOB.all_species[species]
character.set_species(S.type) // Yell at me if this causes everything to melt
character.set_species(S.type, delay_icon_update = TRUE) // Yell at me if this causes everything to melt
if(be_random_name)
real_name = random_name(gender, species)
@@ -1885,7 +1885,7 @@
message_admins("[key_name_admin(character)] has spawned with their gender as plural or neuter. Please notify coders.")
character.change_gender(MALE)
character.change_eye_color(e_colour)
character.change_eye_color(e_colour, skip_icons = TRUE)
character.original_eye_color = e_colour
if(disabilities & DISABILITY_FLAG_FAT)
@@ -1945,12 +1945,11 @@
character.dna.ready_dna(character, flatten_SE = FALSE)
character.sync_organ_dna(assimilate = TRUE)
character.UpdateAppearance()
// Do the initial caching of the player's body icons.
character.force_update_limbs()
character.update_eyes()
character.regenerate_icons()
character.UpdateAppearance()
//Check if the user has ANY job selected.
/datum/character_save/proc/check_any_job()
@@ -214,7 +214,7 @@
H.ha_style = "None"
update_head_accessory()
/mob/living/carbon/human/proc/change_eye_color(colour = "#000000", update_dna = TRUE)
/mob/living/carbon/human/proc/change_eye_color(colour = "#000000", update_dna = TRUE, skip_icons = FALSE)
// Update the main DNA datum, then sync the change across the organs
var/obj/item/organ/internal/eyes/eyes_organ = get_int_organ(/obj/item/organ/internal/eyes)
if(eyes_organ)
@@ -227,9 +227,11 @@
if(update_dna)
update_dna()
sync_organ_dna(assimilate = FALSE)
update_eyes()
update_body()
if(!skip_icons)
update_eyes()
update_body()
return TRUE
/mob/living/carbon/human/proc/get_eye_color()
@@ -1450,10 +1450,9 @@
if(!delay_icon_update)
UpdateAppearance()
overlays.Cut()
update_mutantrace()
regenerate_icons()
overlays.Cut()
update_mutantrace()
regenerate_icons()
if(dna.species)
return TRUE