From 415b86aefa7bcd0adf393c40f698cbbf395eb19f Mon Sep 17 00:00:00 2001
From: Bloop <13398309+vinylspiders@users.noreply.github.com>
Date: Tue, 30 Sep 2025 16:28:07 -0400
Subject: [PATCH] Fixes damp rag runtime (#93192)
## About The Pull Request
Seems to be caused by add_blood_dna() being passed an empty list (which
happens by default with rags).
see here
`all_blood_dna` is not null but an empty list to start, so we need our
proc to be able to handle such cases
So anytime you clean something that doesn't have blood dna you will get
this runtime.
## Why It's Good For The Game
If someone is cleaning these really can build up. Less runtime log
pollution so we notice important issues.
## Changelog
N/A
---
code/modules/forensics/forensics_helpers.dm | 2 +-
code/modules/reagents/reagent_containers/rag.dm | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/code/modules/forensics/forensics_helpers.dm b/code/modules/forensics/forensics_helpers.dm
index 5b32ee43418..3d7fab59925 100644
--- a/code/modules/forensics/forensics_helpers.dm
+++ b/code/modules/forensics/forensics_helpers.dm
@@ -112,7 +112,7 @@
if (QDELETED(src))
return
. = ..()
- if (isnull(blood_DNA_to_add))
+ if (isnull(blood_DNA_to_add) || !length(blood_DNA_to_add))
return .
if (!islist(blood_DNA_to_add))
CRASH("add_blood_DNA on [src] ([type]) has been passed a non-list blood_DNA_to_add ([blood_DNA_to_add])!")
diff --git a/code/modules/reagents/reagent_containers/rag.dm b/code/modules/reagents/reagent_containers/rag.dm
index bd73f20fe1f..70aa4c23b79 100644
--- a/code/modules/reagents/reagent_containers/rag.dm
+++ b/code/modules/reagents/reagent_containers/rag.dm
@@ -145,7 +145,8 @@
fire_act(500, 100)
// FINALLY add the dna to us
- add_blood_DNA(all_blood_dna)
+ if(length(all_blood_dna))
+ add_blood_DNA(all_blood_dna)
update_appearance()
if(blood_level >= 10)
to_chat(cleaner, span_warning("[src] is too dirty to clean anything else! Wash it first!"))