mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Audits wash/cleaning signals + refactors wash() to ensure no needless mob updates occur (#91259)
## About The Pull Request This has the potential to create a lot of needless mob updates which is not great. Now should only update a mob's clothing if it was actually washed. This PR 1) ensures that all wash() procs return a bitflag. 2) ensures that `wash()` proccalls which result in expensive operations like icon updates only do so when it is necessary ## Why It's Good For The Game Updating mob sprites is expensive, and doing it when nothing has been changed is bad. ## Changelog Nothing really player facing
This commit is contained in:
@@ -57,13 +57,14 @@
|
||||
/obj/item/reagent_containers/cup/glass/drinkingglass/proc/on_cleaned(obj/source_component, obj/source)
|
||||
SIGNAL_HANDLER
|
||||
if(!HAS_TRAIT(src, TRAIT_WAS_RENAMED))
|
||||
return
|
||||
return NONE
|
||||
|
||||
qdel(GetComponent(/datum/component/rename))
|
||||
REMOVE_TRAIT(src, TRAIT_WAS_RENAMED, SHAKER_LABEL_TRAIT)
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
update_appearance(UPDATE_NAME | UPDATE_DESC)
|
||||
return COMPONENT_CLEANED|COMPONENT_CLEANED_GAIN_XP
|
||||
|
||||
//Shot glasses!//
|
||||
// This lets us add shots in here instead of lumping them in with drinks because >logic //
|
||||
|
||||
@@ -204,8 +204,10 @@
|
||||
. = ..()
|
||||
if(!(clean_types & CLEAN_TYPE_BLOOD))
|
||||
return
|
||||
blood_level = 0
|
||||
update_appearance()
|
||||
if(blood_level)
|
||||
blood_level = 0
|
||||
update_appearance()
|
||||
. |= COMPONENT_CLEANED|COMPONENT_CLEANED_GAIN_XP
|
||||
|
||||
///Checks whether or not we should clean.
|
||||
/obj/item/rag/proc/should_clean(datum/cleaning_source, atom/atom_to_clean, mob/living/cleaner)
|
||||
|
||||
Reference in New Issue
Block a user