Fixes nonhuman meat being unusable for any material crafting (#92722)

## About The Pull Request

A ton of mobs don't have blood types so this runtimes constantly and
would produce broken material datums.
This commit is contained in:
SmArtKar
2025-08-30 05:06:38 +02:00
committed by GitHub
parent 603fec7454
commit a858885a70
2 changed files with 15 additions and 12 deletions

View File

@@ -173,11 +173,10 @@
saturation = min(saturation, 1 - added_saturation)
var/list/new_matrix = list(
0, 0, 0, 0, // Ignore original hue
0, saturation, 0, 0, // Multiply the saturation by ours
0, 0, 1 - deducted_light, 0, // If we're highly saturated then remove a bit of lightness to keep some color in
0, 0, 0, 1, // Preserve alpha
hue, added_saturation, 0, 0, // And apply our preferred hue and some saturation if we're oversaturated
0, 0, 0, // Ignore original hue
0, saturation, 0, // Multiply the saturation by ours
0, 0, 1 - deducted_light, // If we're highly saturated then remove a bit of lightness to keep some color in
hue, added_saturation, 0, // And apply our preferred hue and some saturation if we're oversaturated
)
return color_matrix_filter(new_matrix, FILTER_COLOR_HSL)

View File

@@ -134,8 +134,9 @@
subjectname = source.name
var/datum/blood_type/blood_type = source.get_bloodtype()
color = blood_type.get_color()
if (blood_type && blood_type.get_color() != BLOOD_COLOR_RED)
var/list/transition_filter = color_transition_filter(blood_type.get_color())
color = transition_filter["color"]
blood_dna = source.get_blood_dna_list()
if(ishuman(source))
@@ -155,7 +156,9 @@
if(source.exotic_bloodtype)
var/datum/blood_type/blood_type = get_blood_type(source.exotic_bloodtype)
color = blood_type.get_color()
if (blood_type && blood_type.get_color() != BLOOD_COLOR_RED)
var/list/transition_filter = color_transition_filter(blood_type.get_color())
color = transition_filter["color"]
blood_dna = list("[blood_type.dna_string]" = blood_type)
return ..()
@@ -170,8 +173,9 @@
var/list/blood_data = source.data
name = "[blood_data["real_name"] || "mystery"] [initial(name)]"
var/datum/blood_type/blood_type = blood_data["blood_type"]
if(blood_type)
color = blood_type.get_color()
if(blood_type && blood_type.get_color() != BLOOD_COLOR_RED)
var/list/transition_filter = color_transition_filter(blood_type.get_color())
color = transition_filter["color"]
blood_dna = list("[blood_type.dna_string]" = blood_type)
else
color = source.color