From a238c0a6fb7d774a42004c5fc412bb8d90a734a9 Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Tue, 15 Nov 2022 09:44:17 -0500 Subject: [PATCH] Fixes the ghost role spawner spawning a naked human while waiting on you to decide whether you want to use the character from your preferences or not (#17319) Fixes the ghost role spawner spawning a naked human while waiting on user input --- code/modules/mob_spawn/mob_spawn.dm | 16 ------------ .../code/modules/mob_spawn/mob_spawn.dm | 25 +++++++++++++++++++ tgstation.dme | 1 + 3 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 modular_skyrat/master_files/code/modules/mob_spawn/mob_spawn.dm diff --git a/code/modules/mob_spawn/mob_spawn.dm b/code/modules/mob_spawn/mob_spawn.dm index a78abf2e224..e422be22686 100644 --- a/code/modules/mob_spawn/mob_spawn.dm +++ b/code/modules/mob_spawn/mob_spawn.dm @@ -189,22 +189,6 @@ /obj/effect/mob_spawn/ghost_role/special(mob/living/spawned_mob, mob/mob_possessor) . = ..() - // SKYRAT EDIT ADDITION - //if we can load our own appearance and its not restricted, try - if(!random_appearance && mob_possessor?.client && ishuman(spawned_mob)) - //if we have gotten to this point, they have already waived their species pref.-- they were told they need to use the specific species already - if((restricted_species && (mob_possessor?.client?.prefs?.read_preference(/datum/preference/choiced/species) in restricted_species)) || !restricted_species) - var/appearance_choice = tgui_alert(mob_possessor, "Use currently loaded character preferences?", "Appearance Type", list("Yes", "No")) - if(appearance_choice == "Yes") - var/mob/living/carbon/human/spawned_human = spawned_mob - mob_possessor?.client?.prefs?.safe_transfer_prefs_to(spawned_human) - spawned_human.dna.update_dna_identity() - if(quirks_enabled) - SSquirks.AssignQuirks(spawned_human, mob_possessor.client) - if(loadout_enabled) - spawned_human.equip_outfit_and_loadout(outfit, mob_possessor.client.prefs) - - // SKYRAT EDIT END if(mob_possessor) spawned_mob.ckey = mob_possessor.ckey if(show_flavor) diff --git a/modular_skyrat/master_files/code/modules/mob_spawn/mob_spawn.dm b/modular_skyrat/master_files/code/modules/mob_spawn/mob_spawn.dm new file mode 100644 index 00000000000..d6034afde67 --- /dev/null +++ b/modular_skyrat/master_files/code/modules/mob_spawn/mob_spawn.dm @@ -0,0 +1,25 @@ +/obj/effect/mob_spawn/ghost_role/create(mob/mob_possessor, newname) + var/load_prefs = FALSE + //if we can load our own appearance and its not restricted, try + if(!random_appearance && mob_possessor?.client) + //if we have gotten to this point, they have already waived their species pref.-- they were told they need to use the specific species already + if((restricted_species && (mob_possessor?.client?.prefs?.read_preference(/datum/preference/choiced/species) in restricted_species)) || !restricted_species) + var/appearance_choice = tgui_alert(mob_possessor, "Use currently loaded character preferences?", "Appearance Type", list("Yes", "No")) + if(appearance_choice == "Yes") + load_prefs = TRUE + + var/mob/living/carbon/human/spawned_human = ..() + + if(!load_prefs) + return spawned_human + + spawned_human?.client?.prefs?.safe_transfer_prefs_to(spawned_human) + spawned_human.dna.update_dna_identity() + + if(quirks_enabled) + SSquirks.AssignQuirks(spawned_human, spawned_human.client) + + if(loadout_enabled) + spawned_human.equip_outfit_and_loadout(outfit, spawned_human.client.prefs) + + return spawned_human diff --git a/tgstation.dme b/tgstation.dme index 5bb347e0672..89d2f3c3343 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5047,6 +5047,7 @@ #include "modular_skyrat\master_files\code\modules\mob\living\simple_animal\hostile\bubblegum.dm" #include "modular_skyrat\master_files\code\modules\mob\living\simple_animal\hostile\grabbagmob.dm" #include "modular_skyrat\master_files\code\modules\mob\living\simple_animal\hostile\zombie.dm" +#include "modular_skyrat\master_files\code\modules\mob_spawn\mob_spawn.dm" #include "modular_skyrat\master_files\code\modules\mod\mod_clothes.dm" #include "modular_skyrat\master_files\code\modules\mod\mod_types.dm" #include "modular_skyrat\master_files\code\modules\mod\modules\_module.dm"