From b04ed3ce50bb93c5ee994aaf2fc6fe37e44d3b70 Mon Sep 17 00:00:00 2001 From: Jacquerel Date: Wed, 23 Apr 2025 23:29:47 +0100 Subject: [PATCH] Decals will fall downwards (#90772) ## About The Pull Request Decals which attempt to spawn on an openspace turf will drop to the level below until they hit a solid turf. Here I demonstrate it with an average spaceman activity, spraying flour aimlessly out of a spray bottle: ![dreamseeker_2e37UCLtuY](https://github.com/user-attachments/assets/a282ecdf-8a59-4418-a86e-2e7ceb675c9d) ## Why It's Good For The Game The other day I watched a drunken miner flying around the upper levels of Catwalkstation and once he became blackout drunk his drunken personality decided to spin rapidly until he vomited. The vomit hovered in the air. This will not stand. ## Changelog :cl: fix: You can now bleed or vomit onto people below you rather than creating puddles of substance hovering in mid-air. /:cl: --- code/game/objects/effects/decals/cleanable.dm | 11 +++++++++-- code/game/objects/effects/decals/decal.dm | 2 ++ .../reagents/chemistry/reagents/other_reagents.dm | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 752d4b784ab..15b8ca546af 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -23,11 +23,18 @@ /// Use this if your decal is one of one, and thus we should not spawn it if it's there already /// Returns either the existing cleanable, the one we created, or null if we can't spawn on that turf /turf/proc/spawn_unique_cleanable(obj/effect/decal/cleanable/cleanable_type) + var/turf/checkturf = src + while (isgroundlessturf(checkturf) && checkturf.zPassOut(DOWN)) + var/turf/below = GET_TURF_BELOW(checkturf) + if (!below || !below.zPassIn(DOWN)) + break + checkturf = below + // There is no need to spam unique cleanables, they don't stack and it just chews cpu - var/obj/effect/decal/cleanable/existing = locate(cleanable_type) in src + var/obj/effect/decal/cleanable/existing = locate(cleanable_type) in checkturf if(existing) return existing - return new cleanable_type(src) + return new cleanable_type(checkturf) /obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases) . = ..() diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index 646713a21d7..e5fce2731fb 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -15,6 +15,8 @@ var/static/list/loc_connections = list( COMSIG_TURF_CHANGE = PROC_REF(on_decal_move), ) + while(isopenspaceturf(loc) && can_z_move(DOWN, z_move_flags = ZMOVE_ALLOW_ANCHORED)) + zMove(DOWN, z_move_flags = ZMOVE_ALLOW_ANCHORED) AddElement(/datum/element/connect_loc, loc_connections) /obj/effect/decal/blob_act(obj/structure/blob/B) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index ef5dd8d0a85..404840175a5 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -3089,7 +3089,7 @@ /datum/reagent/ants/expose_turf(turf/exposed_turf, reac_volume) . = ..() - if(!istype(exposed_turf) || isspaceturf(exposed_turf)) // Is the turf valid + if(!istype(exposed_turf)) // Is the turf valid return if((reac_volume <= 10)) // Makes sure people don't duplicate ants. return