diff --git a/code/controllers/subsystem/dynamic/dynamic_ruleset_midround.dm b/code/controllers/subsystem/dynamic/dynamic_ruleset_midround.dm index 8631eaf4670..72dea251598 100644 --- a/code/controllers/subsystem/dynamic/dynamic_ruleset_midround.dm +++ b/code/controllers/subsystem/dynamic/dynamic_ruleset_midround.dm @@ -230,11 +230,8 @@ if(isnull(body)) return candidate.transfer_to(body, force_key_move = TRUE) // yoinks the candidate's client - if(ishuman(body)) - var/mob/living/carbon/human/human_body = body - body.client?.prefs.safe_transfer_prefs_to(body) - human_body.dna.remove_all_mutations() - human_body.dna.update_dna_identity() + if(ishuman(body) && apply_prefs_to_body(body)) + on_prefs_applied(body) /** * Handles making the body for the candidate @@ -262,6 +259,24 @@ role_name_text = readable_poll_role, ) +/** + * Handles prepping the body with the candidate's prefs + * + * Applies prefs to a given body. Usually that's what you want, but sometimes you don't, in which case you can override this proc. + * Returns TRUE if prefs were applied + */ +/datum/dynamic_ruleset/midround/from_ghosts/proc/apply_prefs_to_body(mob/living/carbon/human/body) + body.client?.prefs.safe_transfer_prefs_to(body) + body.dna.remove_all_mutations() + body.dna.update_dna_identity() + return TRUE + +/** + * Handles anything extra you want to happen after applying prefs + */ +/datum/dynamic_ruleset/midround/from_ghosts/proc/on_prefs_applied(mob/living/carbon/human/body) + return + /datum/dynamic_ruleset/midround/from_ghosts/wizard name = "Wizard" config_tag = "Midround Wizard" @@ -512,6 +527,9 @@ max_antag_cap = 1 signup_atom_appearance = /obj/item/light_eater +/datum/dynamic_ruleset/midround/from_ghosts/nightmare/apply_prefs_to_body(mob/living/carbon/human/body) + return FALSE + /datum/dynamic_ruleset/midround/from_ghosts/nightmare/can_be_selected() return ..() && !isnull(find_maintenance_spawn(atmos_sensitive = TRUE, require_darkness = TRUE))