Fixes topdown emissives/emissive blockers and blood trail rendering (#92430)

## About The Pull Request

Fixes this

<img width="983" height="591" alt="zen_Mhqh2OqiU4"
src="https://github.com/user-attachments/assets/b3275052-1b24-404b-82bc-a4c8e88bdbcf"
/>

This code is mildly bad, but this is the best way we can fix FLOAT_LAYER
topdown emissives/blockers rendering ontop of everything else.

Also added logging/unit testing for blood trails spawned outside of
holders, mappers can use holders to spawn trails (which is the right way
to add them to your maps)

## Changelog
🆑
fix: Fixed blood/glass floor glow going over objects
/🆑
This commit is contained in:
SmArtKar
2025-08-06 23:13:05 +00:00
committed by GitHub
parent 2ec5be871e
commit ea0fa299c4
5 changed files with 51 additions and 6 deletions
@@ -119,7 +119,7 @@
. += blood_emissive(icon, icon_state)
/obj/effect/decal/cleanable/blood/proc/blood_emissive(icon_to_use, icon_state_to_use)
return emissive_appearance(icon_to_use, icon_state_to_use, src, layer, 255 * emissive_alpha / alpha)
return emissive_appearance(icon_to_use, icon_state_to_use, src, alpha = 255 * emissive_alpha / alpha)
/obj/effect/decal/cleanable/blood/lazy_init_reagents()
if (reagents)
@@ -459,6 +459,25 @@
/// Beyond a threshold we change to a bloodier icon state
var/very_bloody = FALSE
/obj/effect/decal/cleanable/blood/trail/Initialize(mapload, list/datum/disease/diseases, list/blood_or_dna)
. = ..()
// Despite having VIS_INHERIT_PLANE, our emissives still inherit our plane offset, so we need to inherit our parent's offset to have them render correctly
if(istype(loc, /obj/effect/decal/cleanable/blood/trail_holder))
SET_PLANE_EXPLICIT(src, initial(plane), loc)
if (emissive_alpha && !dried)
update_appearance() // correct our emissive
return
#ifndef UNIT_TESTS
if (mapload)
log_mapping("[src] spawned outside of a trail holder at [AREACOORD(src)]!")
return INITIALIZE_HINT_QDEL
#endif
stack_trace("[src] spawned outside of a trail holder at [AREACOORD(src)]!")
return INITIALIZE_HINT_QDEL
/obj/effect/decal/cleanable/blood/trail/update_desc(updates)
. = ..()
desc = "A [dried ? "dried " : ""]trail of [get_blood_string()]."