mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +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:
@@ -375,13 +375,17 @@
|
||||
. = ..()
|
||||
if(!(clean_types & CLEAN_SCRUB))
|
||||
return
|
||||
set_opacity(initial(opacity))
|
||||
remove_atom_colour(WASHABLE_COLOUR_PRIORITY)
|
||||
var/initial_opacity = initial(opacity)
|
||||
if(opacity != initial_opacity)
|
||||
set_opacity(initial_opacity)
|
||||
. |= COMPONENT_CLEANED|COMPONENT_CLEANED_GAIN_XP
|
||||
for(var/atom/movable/cleanables as anything in src)
|
||||
if(cleanables == src)
|
||||
continue
|
||||
if(!cleanables.wash(clean_types))
|
||||
var/cleanable_washed = cleanables.wash(clean_types)
|
||||
if(!cleanable_washed)
|
||||
continue
|
||||
. |= cleanable_washed
|
||||
vis_contents -= cleanables
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user