From 355d8b7a8cedc2a0c8c281c0c9c086f18e4be774 Mon Sep 17 00:00:00 2001 From: Sun-Soaked <45698967+MemedHams@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:09:18 -0500 Subject: [PATCH] I vant to fix your bugs grabs the rest of the port + merges some behavior --- code/__byond_version_compat.dm | 4 ++-- code/datums/components/forensics.dm | 4 +++- code/datums/elements/decals/blood.dm | 26 +++++++------------------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/code/__byond_version_compat.dm b/code/__byond_version_compat.dm index 171abd096811..091941eb4f33 100644 --- a/code/__byond_version_compat.dm +++ b/code/__byond_version_compat.dm @@ -16,8 +16,8 @@ #endif #if (DM_VERSION == 514 && DM_BUILD == 1589) -#error Warning! Byond 514.1589 has been known to be unstable. Use at your own risk. -#error Please consider using 514.1588. +//#error Warning! Byond 514.1589 has been known to be unstable. Use at your own risk. +//#error Please consider using 514.1588. #endif // Keep savefile compatibilty at minimum supported level diff --git a/code/datums/components/forensics.dm b/code/datums/components/forensics.dm index e92e6eec3ee1..3c006073304c 100644 --- a/code/datums/components/forensics.dm +++ b/code/datums/components/forensics.dm @@ -190,4 +190,6 @@ return if(!length(blood_DNA)) return - parent.AddElement(/datum/element/decal/blood, _color = get_blood_dna_color(blood_DNA)) + if(isitem(parent)) + var/obj/item/I = parent + I.AddElement(/datum/element/decal/blood, initial(I.icon) || I.icon, initial(I.icon_state) || I.icon_state, _color = get_blood_dna_color(blood_DNA)) diff --git a/code/datums/elements/decals/blood.dm b/code/datums/elements/decals/blood.dm index a2a7245eea9a..85f75bef2416 100644 --- a/code/datums/elements/decals/blood.dm +++ b/code/datums/elements/decals/blood.dm @@ -12,27 +12,15 @@ return ..() /datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha, source) - var/obj/item/I = source - if(!_icon) - _icon = 'icons/effects/blood.dmi' - if(!_icon_state) - _icon_state = "itemblood" + if(!_icon || !_icon_state) + return FALSE if(!_color) _color = COLOR_BLOOD - var/item_icon = I.icon - var/item_icon_state = I.icon_state - var/static/list/blood_splatter_appearances = list() - //try to find a pre-processed blood-splatter. otherwise, make a new one - var/index = "[REF(item_icon)]-[item_icon_state]" - pic = blood_splatter_appearances[index] - - if(!pic) - var/icon/blood_splatter_icon = icon(I.icon, I.icon_state, null, 1) //we only want to apply blood-splatters to the initial icon_state for each object - blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) - blood_splatter_icon.Blend(icon(_icon, _icon_state), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant - pic = mutable_appearance(blood_splatter_icon, initial(I.icon_state)) - pic.color = _color - blood_splatter_appearances[index] = pic + var/icon/blood_splatter_icon = icon(_icon, _icon_state, , 1) //we only want to apply blood-splatters to the initial icon_state for each object + blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) + blood_splatter_icon.Blend(icon('icons/effects/blood.dmi', "itemblood"), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant + pic = mutable_appearance(blood_splatter_icon) + pic.color = _color return TRUE /datum/element/decal/blood/proc/get_examine_name(datum/source, mob/user, list/override)