diff --git a/code/game/objects/cleaning.dm b/code/game/objects/cleaning.dm index 0405e4846c5..fb69ffd80ff 100644 --- a/code/game/objects/cleaning.dm +++ b/code/game/objects/cleaning.dm @@ -15,6 +15,20 @@ // skip_do_after - When TRUE, do after and visible messages are disabled +/atom/proc/is_dirty() + if(HAS_TRAIT(src, TRAIT_CMAGGED)) // So we don't need a cleaning_act for every cmaggable object + return TRUE + if(ismob(src)) + // Mobs always get cleaned directly, because humans have clothing that needs cleaning, and because it'd just feel weird to automatically clean under them. + return TRUE + if(blood_DNA) + return TRUE + for(var/obj/effect/decal/cleanable/C in src) + return TRUE + for(var/obj/effect/heretic_rune/H in src) + return TRUE + return FALSE + /atom/proc/cleaning_act(mob/user, atom/cleaner, cleanspeed = 5 SECONDS, text_verb = "clean", text_description = " with [cleaner].", text_targetname = name, skip_do_after = FALSE) var/is_cmagged = FALSE @@ -22,24 +36,12 @@ to_chat(user, SPAN_NOTICE("You need to take that [text_targetname] off before cleaning it.")) return FALSE - var/is_dirty = FALSE + var/is_dirty = is_dirty() + if(HAS_TRAIT(src, TRAIT_CMAGGED)) //So we don't need a cleaning_act for every cmaggable object is_cmagged = TRUE text_verb = "clean the ooze off" cleanspeed = CMAG_CLEANTIME - is_dirty = TRUE - else if(ismob(src)) - // Mobs always get cleaned directly, because humans have clothing that needs cleaning, and because it'd just feel weird to automatically clean under them. - is_dirty = TRUE - else if(blood_DNA) - is_dirty = TRUE - else - for(var/obj/effect/decal/cleanable/C in src) - is_dirty = TRUE - break - for(var/obj/effect/heretic_rune/H in src) - is_dirty = TRUE - break if(!is_dirty && !isturf(src)) // We don't need cleaning, so let's spare the janitor a pixel hunt and let the floor under us get cleaned instead. diff --git a/code/game/objects/items/soap.dm b/code/game/objects/items/soap.dm index 3f4fd91e202..f1355dd9601 100644 --- a/code/game/objects/items/soap.dm +++ b/code/game/objects/items/soap.dm @@ -24,6 +24,9 @@ /obj/item/soap/interact_with_atom(atom/target, mob/living/user, list/modifiers) if(!ismob(target)) + // if it's a storage item and it isn't dirty, just put the soap in the storage + if(isstorage(target) && !target.is_dirty()) + return ..() target.cleaning_act(user, src, cleanspeed) return ITEM_INTERACT_COMPLETE diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index 0a48106c1a0..0d6d9d5422a 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -62,6 +62,10 @@ if(istype(target, /obj/structure/janitorialcart/) || istype(target, /obj/structure/mopbucket)) return ITEM_INTERACT_COMPLETE + // if it's a storage item and it isn't dirty, just put the mop in the storage + if(isstorage(target) && !target.is_dirty()) + return ..() + if(reagents.total_volume < 1) to_chat(user, SPAN_WARNING("Your mop is dry!")) return ITEM_INTERACT_COMPLETE diff --git a/code/modules/detective_work/footprints_and_rag.dm b/code/modules/detective_work/footprints_and_rag.dm index b0fa9f6c256..d6c4e3abf25 100644 --- a/code/modules/detective_work/footprints_and_rag.dm +++ b/code/modules/detective_work/footprints_and_rag.dm @@ -22,6 +22,9 @@ return ..() /obj/item/reagent_containers/glass/rag/normal_act(atom/target, mob/living/user) + // if it's a storage item and it isn't dirty, just put the rag in the storage + if(isstorage(target) && !target.is_dirty()) + return ..() target.cleaning_act(user, src, wipespeed) return TRUE