From 4e8f12644db58231afeffa93b44c0ead073f32a3 Mon Sep 17 00:00:00 2001 From: MX0739 <176184752+MX0739@users.noreply.github.com> Date: Tue, 22 Jul 2025 00:44:15 +0300 Subject: [PATCH] Now you don't need to have 1 unit of water on the mop to use it with other reagents (#91880) --- code/__DEFINES/cleaning.dm | 3 +++ code/datums/components/cleaner.dm | 4 ++++ code/game/objects/items/mop.dm | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/cleaning.dm b/code/__DEFINES/cleaning.dm index a53887dd0ed..f7382af8e82 100644 --- a/code/__DEFINES/cleaning.dm +++ b/code/__DEFINES/cleaning.dm @@ -12,6 +12,9 @@ /// Return to stop cleaner component from blocking interaction chain further /// Only does anything if [CLEAN_BLOCKED] is also returned #define CLEAN_DONT_BLOCK_INTERACTION (1<<3) +/// Return to do cleaning without actually cleaning anything +/// Only does anything if [CLEAN_ALLOWED] is also returned +#define CLEAN_NO_CLEANER_REAGENTS (1<<4) // Different kinds of things that can be cleaned. // Use these when overriding the wash proc or registering for the clean signals to check if your thing should be cleaned diff --git a/code/datums/components/cleaner.dm b/code/datums/components/cleaner.dm index f9134a409a7..ebb691e1dd0 100644 --- a/code/datums/components/cleaner.dm +++ b/code/datums/components/cleaner.dm @@ -89,6 +89,10 @@ * * clean_target set this to false if the target should not be washed and if experience should not be awarded to the user */ /datum/component/cleaner/proc/clean(datum/source, atom/target, mob/living/user, clean_target = TRUE) + //mops don't clean anything unless they're dipped in cleaning reagents + var/callback_return = pre_clean_callback.Invoke(source, target, user) + if(callback_return & CLEAN_NO_CLEANER_REAGENTS) + clean_target = FALSE //make sure we don't attempt to clean something while it's already being cleaned if(HAS_TRAIT(target, TRAIT_CURRENTLY_CLEANING) || (SEND_SIGNAL(target, COMSIG_ATOM_PRE_CLEAN, user) & COMSIG_ATOM_CANCEL_CLEAN)) return diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm index 81d3c438ef5..23244f476b4 100644 --- a/code/game/objects/items/mop.dm +++ b/code/game/objects/items/mop.dm @@ -52,7 +52,7 @@ return CLEAN_BLOCKED if(reagents.has_reagent(amount = 1, chemical_flags = REAGENT_CLEANS)) return CLEAN_ALLOWED - return CLEAN_BLOCKED|CLEAN_NO_XP + return CLEAN_ALLOWED|CLEAN_NO_XP|CLEAN_NO_CLEANER_REAGENTS /** * Applies reagents to the cleaned floor and removes them from the mop.