diff --git a/code/__DEFINES/living.dm b/code/__DEFINES/living.dm index 340bf3608bb5d..2ac320abdecc7 100644 --- a/code/__DEFINES/living.dm +++ b/code/__DEFINES/living.dm @@ -4,6 +4,12 @@ /// Always does *deathgasp when they die /// If unset mobs will only deathgasp if supplied a death sound or custom death message #define ALWAYS_DEATHGASP (1<<1) +/** + * For carbons, this stops bodypart overlays being added to bodyparts from calling mob.update_body_parts(). + * This is useful for situations like initialization or species changes, where + * update_body_parts() is going to be called ONE time once everything is done. + */ +#define STOP_OVERLAY_UPDATE_BODY_PARTS (1<<2) /// Getter for a mob/living's lying angle, otherwise protected #define GET_LYING_ANGLE(mob) (UNLINT(mob.lying_angle)) diff --git a/code/datums/bodypart_overlays/emote_bodypart_overlay.dm b/code/datums/bodypart_overlays/emote_bodypart_overlay.dm index 524dd1760561e..344efc0ead064 100644 --- a/code/datums/bodypart_overlays/emote_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/emote_bodypart_overlay.dm @@ -29,10 +29,6 @@ if(!referenced_bodypart) return ..() referenced_bodypart.remove_bodypart_overlay(src) - if(referenced_bodypart.owner) //Keep in mind that the bodypart could have been severed from the owner by now - referenced_bodypart.owner.update_body_parts() - else - referenced_bodypart.update_icon_dropped() return ..() /** @@ -49,7 +45,6 @@ if(!bodypart) return null bodypart.add_bodypart_overlay(overlay) - src.update_body_parts() return overlay /datum/bodypart_overlay/simple/emote/blush diff --git a/code/datums/components/face_decal.dm b/code/datums/components/face_decal.dm index df70f8a3f4989..6ba57aa2f01f4 100644 --- a/code/datums/components/face_decal.dm +++ b/code/datums/components/face_decal.dm @@ -50,7 +50,6 @@ bodypart_overlay.draw_color = color my_head.add_bodypart_overlay(bodypart_overlay) RegisterSignals(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING), PROC_REF(lost_head)) - carbon_parent.update_body_parts() else normal_overlay = get_normal_overlay() normal_overlay.color = color @@ -79,14 +78,9 @@ if(my_head) if(bodypart_overlay) my_head.remove_bodypart_overlay(bodypart_overlay) - if(!my_head.owner) - my_head.update_icon_dropped() QDEL_NULL(bodypart_overlay) UnregisterSignal(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING)) my_head = null - if(iscarbon(parent)) - var/mob/living/carbon/carbon_parent = parent - carbon_parent.update_body_parts() if(normal_overlay) var/atom/atom_parent = parent UnregisterSignal(atom_parent, COMSIG_ATOM_UPDATE_OVERLAYS) diff --git a/code/datums/diseases/advance/symptoms/shedding.dm b/code/datums/diseases/advance/symptoms/shedding.dm index f0f3136487418..dc475fc887daa 100644 --- a/code/datums/diseases/advance/symptoms/shedding.dm +++ b/code/datums/diseases/advance/symptoms/shedding.dm @@ -46,7 +46,6 @@ /datum/symptom/shedding/proc/baldify(mob/living/carbon/human/baldie, fully_bald) if(fully_bald) baldie.set_facial_hairstyle("Shaved", update = FALSE) - baldie.set_hairstyle("Bald", update = FALSE) + baldie.set_hairstyle("Bald") //this will call update_body_parts() else - baldie.set_hairstyle("Balding Hair", update = FALSE) - baldie.update_body_parts() + baldie.set_hairstyle("Balding Hair") diff --git a/code/datums/quirks/negative_quirks/all_nighter.dm b/code/datums/quirks/negative_quirks/all_nighter.dm index f5288b8221560..cb11ba0d5fa73 100644 --- a/code/datums/quirks/negative_quirks/all_nighter.dm +++ b/code/datums/quirks/negative_quirks/all_nighter.dm @@ -56,15 +56,12 @@ return bodypart_overlay = new() //creates our overlay face.add_bodypart_overlay(bodypart_overlay) - sleepy_head.update_body_parts() //make sure to update icon ///removes the bag overlay /datum/quirk/all_nighter/proc/remove_bags() var/mob/living/carbon/human/sleepy_head = quirk_holder var/obj/item/bodypart/head/face = sleepy_head?.get_bodypart(BODY_ZONE_HEAD) - if(face) - face.remove_bodypart_overlay(bodypart_overlay) - sleepy_head.update_body_parts() + face?.remove_bodypart_overlay(bodypart_overlay) QDEL_NULL(bodypart_overlay) /** diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index cf3d1c88440b3..7a6b263d5893e 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -306,26 +306,12 @@ newRod.activated() if(!itemUser.has_hand_for_held_index(hand)) //If user does not have the corresponding hand anymore, give them one and return the rod to their hand - if(((hand % 2) == 0)) - var/obj/item/bodypart/L = itemUser.newBodyPart(BODY_ZONE_R_ARM, FALSE, FALSE) - if(L.try_attach_limb(itemUser)) - L.update_limb(is_creating = TRUE) - itemUser.update_body_parts() - itemUser.put_in_hand(newRod, hand, forced = TRUE) - else - qdel(L) - consume_owner() //we can't regrow, abort abort - return + var/zone = (hand % 2) ? BODY_ZONE_L_ARM : BODY_ZONE_R_ARM + if(itemUser.regenerate_limb(zone, FALSE)) + itemUser.put_in_hand(newRod, hand, forced = TRUE) else - var/obj/item/bodypart/L = itemUser.newBodyPart(BODY_ZONE_L_ARM, FALSE, FALSE) - if(L.try_attach_limb(itemUser)) - L.update_limb(is_creating = TRUE) - itemUser.update_body_parts() - itemUser.put_in_hand(newRod, hand, forced = TRUE) - else - qdel(L) - consume_owner() //see above comment - return + consume_owner() //we can't regrow, abort abort + return to_chat(itemUser, span_notice("Your arm suddenly grows back with the Rod of Asclepius still attached!")) else //Otherwise get rid of whatever else is in their hand and return the rod to said hand diff --git a/code/game/objects/items/stacks/golem_food/golem_status_effects.dm b/code/game/objects/items/stacks/golem_food/golem_status_effects.dm index ccc5afb5981ed..bb6e90187ef38 100644 --- a/code/game/objects/items/stacks/golem_food/golem_status_effects.dm +++ b/code/game/objects/items/stacks/golem_food/golem_status_effects.dm @@ -108,17 +108,13 @@ /datum/bodypart_overlay/simple/golem_overlay/proc/add_to_bodypart(prefix, obj/item/bodypart/part) icon_state = "[prefix]_[part.body_zone]" attached_bodypart = WEAKREF(part) - part.add_bodypart_overlay(src) + part.add_bodypart_overlay(src, update = FALSE) /datum/bodypart_overlay/simple/golem_overlay/Destroy(force) var/obj/item/bodypart/referenced_bodypart = attached_bodypart.resolve() if(!referenced_bodypart) return ..() referenced_bodypart.remove_bodypart_overlay(src) - if(referenced_bodypart.owner) //Keep in mind that the bodypart could have been severed from the owner by now - referenced_bodypart.owner.update_body_parts() - else - referenced_bodypart.update_icon_dropped() return ..() /// Freezes hunger for the duration diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index a0ed1013f549b..5fd3b2b435a4a 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -346,14 +346,13 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) var/new_hair_color = input(user, "Choose your hair color", "Hair Color", user.hair_color) as color|null if(new_hair_color) - user.set_haircolor(sanitize_hexcolor(new_hair_color), update = FALSE) + user.set_haircolor(sanitize_hexcolor(new_hair_color)) user.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK) if(user.physique == MALE) var/new_face_color = input(user, "Choose your facial hair color", "Hair Color", user.facial_hair_color) as color|null if(new_face_color) - user.set_facial_haircolor(sanitize_hexcolor(new_face_color), update = FALSE) + user.set_facial_haircolor(sanitize_hexcolor(new_face_color)) user.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK) - user.update_body_parts() /obj/structure/mirror/magic/attack_hand(mob/living/carbon/human/user) . = ..() diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index ced02095e410b..be9c6dc1d1cd1 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -112,7 +112,8 @@ trauma.on_gain() //Update the body's icon so it doesnt appear debrained anymore - brain_owner.update_body_parts() + if(!special && !(brain_owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + brain_owner.update_body_parts() /obj/item/organ/internal/brain/mob_remove(mob/living/carbon/organ_owner, special, movement_flags) // Delete skillchips first as parent proc sets owner to null, and skillchips need to know the brain's owner. @@ -134,7 +135,8 @@ if((!gc_destroyed || (owner && !owner.gc_destroyed)) && !(movement_flags & NO_ID_TRANSFER)) transfer_identity(organ_owner) if(!special) - organ_owner.update_body_parts() + if(!(organ_owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + organ_owner.update_body_parts() organ_owner.clear_mood_event("brain_damage") /obj/item/organ/internal/brain/update_icon_state() diff --git a/code/modules/mob/living/carbon/alien/alien_update_icons.dm b/code/modules/mob/living/carbon/alien/alien_update_icons.dm index 468dca3540071..c0e2fdd1067a2 100644 --- a/code/modules/mob/living/carbon/alien/alien_update_icons.dm +++ b/code/modules/mob/living/carbon/alien/alien_update_icons.dm @@ -4,7 +4,7 @@ /mob/living/carbon/alien/update_damage_overlays() //aliens don't have damage overlays. return -/mob/living/carbon/alien/update_body() // we don't use the bodyparts or body layers for aliens. +/mob/living/carbon/alien/update_body(is_creating = FALSE) // we don't use the bodyparts or body layers for aliens. return /mob/living/carbon/alien/update_body_parts()//we don't use the bodyparts layer for aliens. diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 19f83e6625d58..a684621f3189b 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1,7 +1,9 @@ /mob/living/carbon/Initialize(mapload) . = ..() create_carbon_reagents() - update_body_parts() //to update the carbon's new bodyparts appearance + update_body(is_creating = TRUE) //to update the carbon's new bodyparts appearance + living_flags &= ~STOP_OVERLAY_UPDATE_BODY_PARTS + register_context() GLOB.carbon_list += src @@ -12,6 +14,8 @@ //This must be done first, so the mob ghosts correctly before DNA etc is nulled . = ..() + living_flags |= STOP_OVERLAY_UPDATE_BODY_PARTS + QDEL_LIST(hand_bodyparts) QDEL_LIST(organs) QDEL_LIST(bodyparts) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index dbfa3849b25ad..c13ac14b100c1 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -11,7 +11,8 @@ usable_hands = 0 //Populated on init through list/bodyparts mobility_flags = MOBILITY_FLAGS_CARBON_DEFAULT blocks_emissive = EMISSIVE_BLOCK_NONE - living_flags = ALWAYS_DEATHGASP + // STOP_OVERLAY_UPDATE_BODY_PARTS is removed after we call update_body_parts() during init. + living_flags = ALWAYS_DEATHGASP|STOP_OVERLAY_UPDATE_BODY_PARTS ///List of [/obj/item/organ]s in the mob. They don't go in the contents for some reason I don't want to know. var/list/obj/item/organ/organs = list() ///Same as [above][/mob/living/carbon/var/organs], but stores "slot ID" - "organ" pairs for easy access. diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index 94edbc3515179..afa488148de16 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -370,6 +370,9 @@ GLOBAL_LIST_EMPTY(features_by_species) */ /datum/species/proc/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load) SHOULD_CALL_PARENT(TRUE) + + human_who_gained_species.living_flags |= STOP_OVERLAY_UPDATE_BODY_PARTS //Don't call update_body_parts() for every single bodypart overlay added. + // Drop the items the new species can't wear if(human_who_gained_species.hud_used) human_who_gained_species.hud_used.update_locked_slots() @@ -421,6 +424,8 @@ GLOBAL_LIST_EMPTY(features_by_species) properly_gained = TRUE + human_who_gained_species.living_flags &= ~STOP_OVERLAY_UPDATE_BODY_PARTS + /** * Proc called when a carbon is no longer this species. * @@ -431,40 +436,44 @@ GLOBAL_LIST_EMPTY(features_by_species) * * new_species - The new species that the carbon became, used for genetics mutations. * * pref_load - Preferences to be loaded from character setup, loads in preferred mutant things like bodyparts, digilegs, skin color, etc. */ -/datum/species/proc/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load) +/datum/species/proc/on_species_loss(mob/living/carbon/human/human, datum/species/new_species, pref_load) SHOULD_CALL_PARENT(TRUE) - C.butcher_results = null - for(var/X in inherent_traits) - REMOVE_TRAIT(C, X, SPECIES_TRAIT) + + human.living_flags |= STOP_OVERLAY_UPDATE_BODY_PARTS //Don't call update_body_parts() for every single bodypart overlay removed. + human.butcher_results = null + for(var/trait in inherent_traits) + REMOVE_TRAIT(human, trait, SPECIES_TRAIT) //If their inert mutation is not the same, swap it out - if((inert_mutation != new_species.inert_mutation) && LAZYLEN(C.dna.mutation_index) && (inert_mutation in C.dna.mutation_index)) - C.dna.remove_mutation(inert_mutation) + if((inert_mutation != new_species.inert_mutation) && LAZYLEN(human.dna.mutation_index) && (inert_mutation in human.dna.mutation_index)) + human.dna.remove_mutation(inert_mutation) //keep it at the right spot, so we can't have people taking shortcuts - var/location = C.dna.mutation_index.Find(inert_mutation) - C.dna.mutation_index[location] = new_species.inert_mutation - C.dna.default_mutation_genes[location] = C.dna.mutation_index[location] - C.dna.mutation_index[new_species.inert_mutation] = create_sequence(new_species.inert_mutation) - C.dna.default_mutation_genes[new_species.inert_mutation] = C.dna.mutation_index[new_species.inert_mutation] + var/location = human.dna.mutation_index.Find(inert_mutation) + human.dna.mutation_index[location] = new_species.inert_mutation + human.dna.default_mutation_genes[location] = human.dna.mutation_index[location] + human.dna.mutation_index[new_species.inert_mutation] = create_sequence(new_species.inert_mutation) + human.dna.default_mutation_genes[new_species.inert_mutation] = human.dna.mutation_index[new_species.inert_mutation] if(inherent_factions) for(var/i in inherent_factions) - C.faction -= i + human.faction -= i - clear_tail_moodlets(C) + clear_tail_moodlets(human) - remove_body_markings(C) + remove_body_markings(human) // Removes all languages previously associated with [LANGUAGE_SPECIES], gaining our new species will add new ones back var/datum/language_holder/losing_holder = GLOB.prototype_language_holders[species_language_holder] for(var/language in losing_holder.understood_languages) - C.remove_language(language, UNDERSTOOD_LANGUAGE, LANGUAGE_SPECIES) + human.remove_language(language, UNDERSTOOD_LANGUAGE, LANGUAGE_SPECIES) for(var/language in losing_holder.spoken_languages) - C.remove_language(language, SPOKEN_LANGUAGE, LANGUAGE_SPECIES) + human.remove_language(language, SPOKEN_LANGUAGE, LANGUAGE_SPECIES) for(var/language in losing_holder.blocked_languages) - C.remove_blocked_language(language, LANGUAGE_SPECIES) + human.remove_blocked_language(language, LANGUAGE_SPECIES) + + SEND_SIGNAL(human, COMSIG_SPECIES_LOSS, src) - SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src) + human.living_flags &= ~STOP_OVERLAY_UPDATE_BODY_PARTS /** * Handles the body of a human @@ -840,8 +849,7 @@ GLOBAL_LIST_EMPTY(features_by_species) if(QDELETED(target)) //may be called from a timer return target.set_facial_hairstyle("Shaved", update = FALSE) - target.set_hairstyle("Bald", update = FALSE) - target.update_body_parts() + target.set_hairstyle("Bald") //This calls update_body_parts() ////////////////// // ATTACK PROCS // diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 903d489846ab2..29134e5097697 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -15,7 +15,9 @@ setup_human_dna() create_carbon_reagents() - set_species(dna.species.type) + set_species(dna.species.type, icon_update = FALSE) //carbon/Initialize will call update_body() + //set species enables and disables the flag. Just to be sure, we re-enable it now until it's removed by the parent call. + living_flags |= STOP_OVERLAY_UPDATE_BODY_PARTS prepare_huds() //Prevents a nasty runtime on human init diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index c26b22b0711da..627e8daac0db5 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -521,8 +521,7 @@ affecting.receive_damage(acidity, 2*acidity) emote("scream") set_facial_hairstyle("Shaved", update = FALSE) - set_hairstyle("Bald", update = FALSE) - update_body_parts() + set_hairstyle("Bald") //This calls update_body_parts() ADD_TRAIT(src, TRAIT_DISFIGURED, TRAIT_GENERIC) update_damage_overlays() diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index d8cc74b1079a6..393b91ae02b9f 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1606,8 +1606,7 @@ if(!(methods & (TOUCH|VAPOR)) || !ishuman(exposed_human) || (reac_volume < 0.5)) return exposed_human.set_facial_haircolor("#9922ff", update = FALSE) - exposed_human.set_haircolor(color, update = TRUE) - exposed_human.update_body_parts() + exposed_human.set_haircolor(color) //this will call update_body_parts() /datum/reagent/medicine/polypyr/overdose_process(mob/living/affected_mob, seconds_per_tick, times_fired) . = ..() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index bbaad188151a2..cb0cf9ae6620c 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2193,8 +2193,7 @@ var/mob/living/carbon/human/exposed_human = exposed_mob exposed_human.set_facial_haircolor(pick(potential_colors), update = FALSE) - exposed_human.set_haircolor(pick(potential_colors), update = TRUE) - exposed_human.update_body_parts() + exposed_human.set_haircolor(pick(potential_colors)) //this will call update_body_parts() /datum/reagent/barbers_aid name = "Barber's Aid" @@ -2252,13 +2251,11 @@ if(!head || (head.head_flags & HEAD_HAIR)) return head.head_flags |= HEAD_HAIR - var/message if(HAS_TRAIT(affected_mob, TRAIT_BALD)) - message = span_warning("You feel your scalp mutate, but you are still hopelessly bald.") + to_chat(affected_mob, span_warning("You feel your scalp mutate, but you are still hopelessly bald.")) else - message = span_notice("Your scalp mutates, a full head of hair sprouting from it.") - to_chat(affected_mob, message) - human_mob.update_body_parts() + to_chat(affected_mob, span_notice("Your scalp mutates, a full head of hair sprouting from it.")) + human_mob.update_body_parts() /datum/reagent/baldium name = "Baldium" diff --git a/code/modules/surgery/advanced/wingreconstruction.dm b/code/modules/surgery/advanced/wingreconstruction.dm index 3234b61e1e043..21e34efc2d76d 100644 --- a/code/modules/surgery/advanced/wingreconstruction.dm +++ b/code/modules/surgery/advanced/wingreconstruction.dm @@ -53,7 +53,7 @@ wings.heal_wings(user, ALL) var/obj/item/organ/external/antennae/antennae = target.get_organ_slot(ORGAN_SLOT_EXTERNAL_ANTENNAE) //i mean we might aswell heal their antennae too - antennae?.heal_antennae() + antennae?.heal_antennae(user, ALL) human_target.update_body_parts() return ..() diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 0b953b9313d04..931518685f654 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -230,7 +230,7 @@ if(texture_bodypart_overlay) texture_bodypart_overlay = new texture_bodypart_overlay() - add_bodypart_overlay(texture_bodypart_overlay) + add_bodypart_overlay(texture_bodypart_overlay, update = FALSE) if(!IS_ORGANIC_LIMB(src)) grind_results = null @@ -1088,14 +1088,26 @@ thing_to_husk.add_overlay(husk_blood) ///Add a bodypart overlay and call the appropriate update procs -/obj/item/bodypart/proc/add_bodypart_overlay(datum/bodypart_overlay/overlay) +/obj/item/bodypart/proc/add_bodypart_overlay(datum/bodypart_overlay/overlay, update = TRUE) bodypart_overlays += overlay overlay.added_to_limb(src) + if(!update) + return + if(!owner) + update_icon_dropped() + else if(!(owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + owner.update_body_parts() ///Remove a bodypart overlay and call the appropriate update procs -/obj/item/bodypart/proc/remove_bodypart_overlay(datum/bodypart_overlay/overlay) +/obj/item/bodypart/proc/remove_bodypart_overlay(datum/bodypart_overlay/overlay, update = TRUE) bodypart_overlays -= overlay overlay.removed_from_limb(src) + if(!update) + return + if(!owner) + update_icon_dropped() + else if(!(owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + owner.update_body_parts() /obj/item/bodypart/atom_deconstruct(disassembled = TRUE) SHOULD_CALL_PARENT(TRUE) @@ -1301,10 +1313,10 @@ if(!isnull(dimorphic)) is_dimorphic = dimorphic - if(owner) - owner.update_body_parts() - else + if(!owner) update_icon_dropped() + else if(!(owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + owner.update_body_parts() //This foot gun needs a safety if(!icon_exists(icon_holder, "[limb_id]_[body_zone][is_dimorphic ? "_[limb_gender]" : ""]")) @@ -1319,10 +1331,10 @@ is_dimorphic = initial(is_dimorphic) should_draw_greyscale = initial(should_draw_greyscale) - if(owner) - owner.update_body_parts() - else + if(!owner) update_icon_dropped() + else if(!(owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) + owner.update_body_parts() // Note: For effects on subtypes, use the emp_effect() proc instead /obj/item/bodypart/emp_act(severity) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index c53443503fdd5..6ee76a9f695af 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -121,7 +121,8 @@ update_icon_dropped() phantom_owner.update_health_hud() //update the healthdoll phantom_owner.update_body() - phantom_owner.update_body_parts() + if(!special) + phantom_owner.hud_used?.update_locked_slots() if(bodypart_flags & BODYPART_PSEUDOPART) drop_organs(phantom_owner) //Psuedoparts shouldn't have organs, but just in case diff --git a/code/modules/surgery/organs/external/_visual_organs.dm b/code/modules/surgery/organs/external/_visual_organs.dm index 7ac88de4d60bd..76de51229b691 100644 --- a/code/modules/surgery/organs/external/_visual_organs.dm +++ b/code/modules/surgery/organs/external/_visual_organs.dm @@ -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() . = ..() diff --git a/code/modules/surgery/organs/organ_movement.dm b/code/modules/surgery/organs/organ_movement.dm index d2e01b4e3abc5..99a74d9b491e1 100644 --- a/code/modules/surgery/organs/organ_movement.dm +++ b/code/modules/surgery/organs/organ_movement.dm @@ -18,7 +18,7 @@ mob_insert(receiver, special, movement_flags) bodypart_insert(limb_owner = receiver, movement_flags = movement_flags) - if(!special) + if(!special && !(receiver.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) receiver.update_body_parts() /* @@ -33,7 +33,7 @@ mob_remove(organ_owner, special, movement_flags) bodypart_remove(limb_owner = organ_owner, movement_flags = movement_flags) - if(!special) + if(!special && !(organ_owner.living_flags & STOP_OVERLAY_UPDATE_BODY_PARTS)) organ_owner.update_body_parts() /*