update_body_parts() is now called when adding or removing bodypart overlays. (#87215)

## About The Pull Request
I'm making sure that `update_body_parts()` is properly called when
changing bodypart overlays, so that they actually show up the very
moment they were changed. However, to avoid redundant
`update_body_parts()` calls on init or while changing species, I've
added a living flag that stops `update_body_parts()` from being called
in these situations. I also scoured the codebase for other redundant
`update_body_parts()` to remove and things to clean up a little.

## Why It's Good For The Game
This automates the process of calling `update_body_parts()` a bit.

## Changelog
Mainly backend.
This commit is contained in:
Ghom
2024-10-15 18:49:05 +02:00
committed by GitHub
parent 73f72b7129
commit 734051bb1f
23 changed files with 93 additions and 101 deletions
+3 -4
View File
@@ -83,11 +83,10 @@ Unlike normal organs, we're actually inside a persons limbs at all times
bodypart_overlay.set_appearance(typed_accessory)
if(owner) //are we in a person?
owner.update_body_parts()
else if(bodypart_owner) //are we in a limb?
if(bodypart_owner) //are we in a limb?
bodypart_owner.update_icon_dropped()
//else if(use_mob_sprite_as_obj_sprite) //are we out in the world, unprotected by flesh?
else if(owner && !(owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) //are we a person?
owner.update_body_parts()
/obj/item/organ/update_overlays()
. = ..()