From dba39d33c70a9ced4c25c184b6aff47c919e2e09 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Sun, 27 Jul 2025 22:15:07 -0500 Subject: [PATCH] Allows set_blood_type to take strings (#92242) --- code/modules/admin/smites/cluwndice.dm | 2 +- code/modules/jobs/job_types/clown.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 5 +++++ code/modules/mob/living/carbon/human/_species.dm | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/smites/cluwndice.dm b/code/modules/admin/smites/cluwndice.dm index 94355eb98db..9838bfd9a89 100644 --- a/code/modules/admin/smites/cluwndice.dm +++ b/code/modules/admin/smites/cluwndice.dm @@ -10,5 +10,5 @@ return var/mob/living/carbon/carbon_target = target - carbon_target.set_blood_type(get_blood_type(BLOOD_TYPE_CLOWN)) + carbon_target.set_blood_type(BLOOD_TYPE_CLOWN) SEND_SOUND(carbon_target, 'sound/items/bikehorn.ogg') diff --git a/code/modules/jobs/job_types/clown.dm b/code/modules/jobs/job_types/clown.dm index 9f2b42231b7..0d6c90b8d6a 100644 --- a/code/modules/jobs/job_types/clown.dm +++ b/code/modules/jobs/job_types/clown.dm @@ -43,7 +43,7 @@ spawned.apply_pref_name(/datum/preference/name/clown, player_client) if(check_holidays(APRIL_FOOLS)) // Clown blood is real var/mob/living/carbon/human/human_clown = spawned - human_clown.set_blood_type(get_blood_type(BLOOD_TYPE_CLOWN)) + human_clown.set_blood_type(BLOOD_TYPE_CLOWN) return ..() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e92afba3b60..0d7d7a196fb 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1323,6 +1323,11 @@ if(isnull(dna)) return + if(istext(new_blood_type)) + new_blood_type = get_blood_type(new_blood_type) + if(!istype(new_blood_type)) + return + if(get_bloodtype() == new_blood_type) // already has this blood type, we don't need to do anything. return diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index fe61673266c..add4efd1805 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -388,7 +388,7 @@ GLOBAL_LIST_EMPTY(features_by_species) if(!human_who_gained_species.get_bloodtype()?.is_species_universal) // Clown blood is forever. //Assigns exotic blood type if the species has one if(exotic_bloodtype && human_who_gained_species.get_bloodtype()?.id != exotic_bloodtype) - human_who_gained_species.set_blood_type(get_blood_type(exotic_bloodtype)) + human_who_gained_species.set_blood_type(exotic_bloodtype) //Otherwise, check if the previous species had an exotic bloodtype and we do not have one and assign a random blood type else if(old_species.exotic_bloodtype && isnull(exotic_bloodtype)) human_who_gained_species.set_blood_type(random_human_blood_type())