mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +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:
@@ -73,29 +73,39 @@
|
||||
|
||||
/// Empties the fingerprints list
|
||||
/datum/forensics/proc/wipe_fingerprints()
|
||||
if(isnull(fingerprints))
|
||||
return NONE
|
||||
|
||||
fingerprints = null
|
||||
return TRUE
|
||||
return COMPONENT_CLEANED
|
||||
|
||||
/// Empties the blood_DNA list
|
||||
/datum/forensics/proc/wipe_blood_DNA()
|
||||
if(isnull(blood_DNA))
|
||||
return NONE
|
||||
|
||||
blood_DNA = null
|
||||
return TRUE
|
||||
return COMPONENT_CLEANED
|
||||
|
||||
/// Empties the fibers list
|
||||
/datum/forensics/proc/wipe_fibers()
|
||||
if(isnull(fibers))
|
||||
return NONE
|
||||
|
||||
fibers = null
|
||||
return TRUE
|
||||
return COMPONENT_CLEANED
|
||||
|
||||
/// Handles cleaning up the various forensic types
|
||||
/datum/forensics/proc/clean_act(datum/source, clean_types)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
. = NONE
|
||||
if(clean_types & CLEAN_TYPE_FINGERPRINTS)
|
||||
wipe_fingerprints()
|
||||
. |= wipe_fingerprints()
|
||||
if(clean_types & CLEAN_TYPE_BLOOD)
|
||||
wipe_blood_DNA()
|
||||
. |= wipe_blood_DNA()
|
||||
if(clean_types & CLEAN_TYPE_FIBERS)
|
||||
wipe_fibers()
|
||||
. |= wipe_fibers()
|
||||
|
||||
/// Adds the given list into fingerprints
|
||||
/datum/forensics/proc/add_fingerprint_list(list/fingerprints)
|
||||
|
||||
Reference in New Issue
Block a user